diff options
author | Edwin Groothuis <edwin@FreeBSD.org> | 2002-11-16 22:28:08 +0000 |
---|---|---|
committer | Edwin Groothuis <edwin@FreeBSD.org> | 2002-11-16 22:28:08 +0000 |
commit | 1420ecfec719ed058b8eae0a9e4199f568a270d1 (patch) | |
tree | df3d87b634871e1f4578c4d57b57e20906c1c901 /net/spread/files/patch-spread.c | |
parent | iMaintainer update to version 2.0.2 (diff) |
Maintainer update to version 3.17.0
PR: ports/45178
Submitted by: Joshua Goodall <joshua@roughtrade.net>
Notes
Notes:
svn path=/head/; revision=70266
Diffstat (limited to 'net/spread/files/patch-spread.c')
-rw-r--r-- | net/spread/files/patch-spread.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net/spread/files/patch-spread.c b/net/spread/files/patch-spread.c new file mode 100644 index 000000000000..1ab2708b1f90 --- /dev/null +++ b/net/spread/files/patch-spread.c @@ -0,0 +1,40 @@ +--- spread.c Sun Nov 10 00:17:59 2002 ++++ spread.c Sun Nov 10 00:18:42 2002 +@@ -65,6 +65,7 @@ + + static void Invalid_privilege_decrease(char *user, char *group); + static void Usage(int argc, char *argv[]); ++static void writepidfile(); + + /* auth-null.c: */ + void null_init(void); +@@ -144,6 +145,8 @@ + + #endif /* ARCH_PC_WIN95 */ + ++ writepidfile(); ++ + /* initialize each valid authentication protocol */ + null_init(); + ip_init(); +@@ -193,6 +196,20 @@ + E_handle_events(); + + return 0; ++} ++ ++static void ++writepidfile() ++{ ++ char pidbuf[11]; ++ int pidfd; ++ ++ if ((pidfd = open(_PATH_SPREAD_PIDDIR "/spread.pid", O_RDWR | O_CREAT, 0644)) == -1) ++ Alarm( EXIT, "Spread: couldn't open pidfile for writing" ); ++ ++ snprintf(pidbuf, sizeof(pidbuf), "%ld\n", (long)getpid()); ++ write(pidfd, pidbuf, strlen(pidbuf)); ++ close(pidfd); + } + + static void Print_help(void) |