Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
ab69b755
Commit
ab69b755
authored
Apr 17, 1999
by
Per Cederqvist
Browse files
(main): Use pidfile to simplify code.
parent
3a9ebaa7
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server/updateLysKOM.c
View file @
ab69b755
/*
* $Id: updateLysKOM.c,v 1.
8
199
8/12/26 22:41:11 by
er
s
Exp $
* $Id: updateLysKOM.c,v 1.
9
199
9/04/17 00:16:46 ced
er Exp $
* Copyright (C) 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -51,6 +51,7 @@
#include
<unistd.h>
#include
"ldifftime.h"
#include
"pidfile.h"
static
void
checkstatus
(
FILE
*
fp
,
...
...
@@ -158,7 +159,7 @@ main (int argc,
{
case
'V'
:
case
'v'
:
fprintf
(
stderr
,
"updateLysKOM %d $Revision: 1.
8
$
\n
"
,
fprintf
(
stderr
,
"updateLysKOM %d $Revision: 1.
9
$
\n
"
,
#include
"version.incl"
);
exit
(
0
);
...
...
@@ -167,24 +168,12 @@ main (int argc,
fprintf
(
stderr
,
"usage: %s [-V]
\n
"
,
argv
[
0
]);
}
fp
=
fopen
(
DEFAULT_PREFIX
"/etc/pid"
,
"r"
);
if
(
fp
==
NULL
)
{
fprintf
(
stderr
,
"%s: warning: %s: "
,
argv
[
0
],
DEFAULT_PREFIX
"/etc/pid"
);
perror
(
""
);
pid
=
0
;
}
else
{
pid
=
0
;
fscanf
(
fp
,
"%lu"
,
&
pid
);
if
(
pid
<
2
)
pid
=
read_pid_file
(
DEFAULT_PREFIX
"/etc/pid"
,
argv
[
0
]);
if
(
pid
==
1
)
{
fprintf
(
stderr
,
"%s: got pid %ld.
\n
"
,
argv
[
0
],
pid
);
exit
(
1
);
}
}
fp
=
fopen
(
DEFAULT_PREFIX
"/etc/status"
,
"r"
);
if
(
fp
!=
NULL
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment