start_stop_daemon: NOMMU fixes, round 2 by Alex Landau <landau_alex@yahoo.com>
[oweals/busybox.git] / networking / udhcp / common.c
1 /* vi: set sw=4 ts=4: */
2 /* common.c
3  *
4  * Functions for debugging and logging as well as some other
5  * simple helper functions.
6  *
7  * Russ Dill <Russ.Dill@asu.edu> 2001-2003
8  * Rewritten by Vladimir Oleynik <dzo@simtreas.ru> (C) 2003
9  *
10  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
11  */
12
13 #include "common.h"
14
15 const uint8_t MAC_BCAST_ADDR[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
16
17 void udhcp_make_pidfile(const char *pidfile)
18 {
19         /* Make sure fd 0,1,2 are open */
20         bb_sanitize_stdio();
21
22         /* Equivalent of doing a fflush after every \n */
23         setlinebuf(stdout);
24
25         /* Create pidfile */
26         if (pidfile && !write_pidfile(pidfile))
27                 bb_perror_msg("cannot create pidfile %s", pidfile);
28
29         bb_info_msg("%s (v%s) started", applet_name, BB_VER);
30 }