aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-14 21:54:42 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-14 21:54:42 +0000
commit94506af280c97f96fc8563d7632cdddac88710a4 (patch)
treea70e107156aef54d8f58f545adea68d4aa144b46
parent617a50a6db497028ff8bddf7d4c7a00e4cdcd8e9 (diff)
downloadbusybox-w32-94506af280c97f96fc8563d7632cdddac88710a4.tar.gz
busybox-w32-94506af280c97f96fc8563d7632cdddac88710a4.tar.bz2
busybox-w32-94506af280c97f96fc8563d7632cdddac88710a4.zip
udhcp: use fdprintf for pidfile creation (smaller code)
git-svn-id: svn://busybox.net/trunk/busybox@18106 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/udhcp/pidfile.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/networking/udhcp/pidfile.c b/networking/udhcp/pidfile.c
index bcb2608c5..be65d5fc9 100644
--- a/networking/udhcp/pidfile.c
+++ b/networking/udhcp/pidfile.c
@@ -52,15 +52,9 @@ int pidfile_acquire(const char *pidfile)
52 52
53void pidfile_write_release(int pid_fd) 53void pidfile_write_release(int pid_fd)
54{ 54{
55 FILE *out;
56
57 if (pid_fd < 0) return; 55 if (pid_fd < 0) return;
58 56
59 out = fdopen(pid_fd, "w"); 57 fdprintf(pid_fd, "%d\n", getpid());
60 if (out) {
61 fprintf(out, "%d\n", getpid());
62 fclose(out);
63 }
64 lockf(pid_fd, F_UNLCK, 0); 58 lockf(pid_fd, F_UNLCK, 0);
65 close(pid_fd); 59 close(pid_fd);
66} 60}