aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-03-14 21:54:42 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-03-14 21:54:42 +0000
commit1ce190b7c1a1af40c1b12f69036e10b9a96ea2c8 (patch)
treea70e107156aef54d8f58f545adea68d4aa144b46 /networking
parent9616aff095d47ac8529f09e43a4e57937eabd9c1 (diff)
downloadbusybox-1ce190b7c1a1af40c1b12f69036e10b9a96ea2c8.tar.gz
udhcp: use fdprintf for pidfile creation (smaller code)
Diffstat (limited to 'networking')
-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)
void pidfile_write_release(int pid_fd)
{
- FILE *out;
-
if (pid_fd < 0) return;
- out = fdopen(pid_fd, "w");
- if (out) {
- fprintf(out, "%d\n", getpid());
- fclose(out);
- }
+ fdprintf(pid_fd, "%d\n", getpid());
lockf(pid_fd, F_UNLCK, 0);
close(pid_fd);
}