aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-02-25 10:27:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-02-25 10:27:29 +0000
commit2e9a798f091f9ddb4e93ab5324632a91189569e1 (patch)
treed1eace1eb60012ed1ea6f5a309f13b9dd55c6b2a
parentb32a39f44f45438993d6b25282913abbeeaaa8af (diff)
create the pidfile and store the pid on invoke
-rw-r--r--tests/server/sws.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 6b6585007..9c76b5155 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -299,6 +299,7 @@ int main(int argc, char *argv[])
unsigned short port = DEFAULT_PORT;
char *logfile = DEFAULT_LOGFILE;
int part_no;
+ FILE *pidfile;
if(argc>1)
port = atoi(argv[1]);
@@ -345,10 +346,18 @@ int main(int argc, char *argv[])
exit(1);
}
+ pidfile = fopen(".http.pid", "w");
+ if(pidfile) {
+ fprintf(pidfile, "%d\n", (int)getpid());
+ fclose(pidfile);
+ }
+ else
+ fprintf(stderr, "Couldn't write pid file\n");
+
/* start accepting connections */
listen(sock, 5);
- printf("*** %s listening on port %u ***\n", VERSION, port);
+ fprintf(stderr, "*** %s listening on port %u ***\n", VERSION, port);
while (!sigterm) {
int doc;