aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/pidfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/pidfile.c')
-rw-r--r--networking/udhcp/pidfile.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/networking/udhcp/pidfile.c b/networking/udhcp/pidfile.c
index 148b07b34..6673c9502 100644
--- a/networking/udhcp/pidfile.c
+++ b/networking/udhcp/pidfile.c
@@ -45,7 +45,7 @@ int pidfile_acquire(const char *pidfile)
45 45
46 pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644); 46 pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644);
47 if (pid_fd < 0) { 47 if (pid_fd < 0) {
48 bb_perror_msg("Unable to open pidfile %s", pidfile); 48 bb_perror_msg("unable to open pidfile %s", pidfile);
49 } else { 49 } else {
50 lockf(pid_fd, F_LOCK, 0); 50 lockf(pid_fd, F_LOCK, 0);
51 if (!saved_pidfile) 51 if (!saved_pidfile)
@@ -63,14 +63,11 @@ void pidfile_write_release(int pid_fd)
63 63
64 if (pid_fd < 0) return; 64 if (pid_fd < 0) return;
65 65
66 if ((out = fdopen(pid_fd, "w")) != NULL) { 66 out = fdopen(pid_fd, "w");
67 if (out) {
67 fprintf(out, "%d\n", getpid()); 68 fprintf(out, "%d\n", getpid());
68 fclose(out); 69 fclose(out);
69 } 70 }
70 lockf(pid_fd, F_UNLCK, 0); 71 lockf(pid_fd, F_UNLCK, 0);
71 close(pid_fd); 72 close(pid_fd);
72} 73}
73
74
75
76