Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nadezhda Ivanova
OpenLDAP
Commits
6bd26a6a
Commit
6bd26a6a
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
remove lint.
parent
977292a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/nt_svc.c
+13
-29
13 additions, 29 deletions
servers/slapd/nt_svc.c
with
13 additions
and
29 deletions
servers/slapd/nt_svc.c
+
13
−
29
View file @
6bd26a6a
...
...
@@ -2,43 +2,23 @@
#include
"portable.h"
#include
<stdio.h>
//#include <ac/signal.h>
//#include <ac/socket.h>
#include
<ac/string.h>
//#include <ac/time.h>
//#include <ac/unistd.h>
//#include <ac/wait.h>
//#include <ac/signal.h>
//#include <ac/errno.h>
#include
"ldap_defaults.h"
#include
"slap.h"
/* kludge a path for now */
#include
"../../libraries/liblutil/slapdmsg.h"
#define SCM_NOTIFICATION_INTERVAL 5000
#define THIRTY_SECONDS (30 * 1000)
ldap_pvt_thread_cond_t
started_event
,
stopped_event
;
ldap_pvt_thread_t
start_status_tid
,
stop_status_tid
;
/
/
in main.c
/
*
in main.c
*/
void
WINAPI
ServiceMain
(
DWORD
argc
,
LPTSTR
*
argv
);
// in wsa_err.c
char
*
WSAGetLastErrorString
(
void
);
// in nt_err.c
char
*
GetLastErrorString
(
void
);
// in ntservice.c
/* in ntservice.c */
int
srv_install
(
char
*
service
,
char
*
filename
);
int
srv_remove
(
char
*
service
,
char
*
filename
);
void
main
(
DWORD
argc
,
LPTSTR
*
argv
)
int
main
(
DWORD
argc
,
LPTSTR
*
argv
)
{
int
length
;
char
filename
[
MAX_PATH
],
*
fname_start
;
...
...
@@ -49,8 +29,10 @@ void main( DWORD argc, LPTSTR *argv )
{
NULL
,
NULL
}
};
/*
// set the service's current directory to being the installation directory for the service.
// this way we don't have to write absolute paths in the configuration files
*/
GetModuleFileName
(
NULL
,
filename
,
sizeof
(
filename
)
);
fname_start
=
strrchr
(
filename
,
*
LDAP_DIRSEP
);
*
fname_start
=
'\0'
;
...
...
@@ -65,15 +47,15 @@ void main( DWORD argc, LPTSTR *argv )
if
(
(
length
=
GetModuleFileName
(
NULL
,
filename
,
sizeof
(
filename
)))
==
0
)
{
fputs
(
"unable to retrieve file name for the service.
\n
"
,
stderr
);
return
;
return
EXIT_FAILURE
;
}
if
(
!
srv_install
(
svcName
,
filename
)
)
{
fputs
(
"service failed installation ...
\n
"
,
stderr
);
return
;
return
EXIT_FAILURE
;
}
fputs
(
"service has been installed ...
\n
"
,
stderr
);
return
;
return
EXIT_SUCCESS
;
}
if
(
_stricmp
(
"remove"
,
argv
[
1
]
)
==
0
)
...
...
@@ -84,15 +66,15 @@ void main( DWORD argc, LPTSTR *argv )
if
(
(
length
=
GetModuleFileName
(
NULL
,
filename
,
sizeof
(
filename
)))
==
0
)
{
fputs
(
"unable to retrieve file name for the service.
\n
"
,
stderr
);
return
;
return
EXIT_FAILURE
;
}
if
(
!
srv_remove
(
svcName
,
filename
)
)
{
fputs
(
"failed to remove the service ...
\n
"
,
stderr
);
return
;
return
EXIT_FAILURE
;
}
fputs
(
"service has been removed ...
\n
"
,
stderr
);
return
;
return
EXIT_SUCCESS
;
}
}
...
...
@@ -102,4 +84,6 @@ void main( DWORD argc, LPTSTR *argv )
is_NT_Service
=
0
;
ServiceMain
(
argc
,
argv
);
}
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment