mirror of
https://github.com/troglobit/finit.git
synced 2026-11-26 20:38:21 +00:00
Replace atoi() with atonum() --> better error handling.
Friends don't let friends use atoi(). Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
ccdab464c3
commit
2adec264af
2 files changed
+31
-5
No files matched your search
@@ -29,11 +29,11 @@
|
||||
#include <syslog.h>
|
||||
|
||||
#define DO_LOG(level, fmt, args...) \
|
||||
{ \
|
||||
do { \
|
||||
openlog("finit", LOG_CONS | LOG_PID, LOG_DAEMON); \
|
||||
syslog(level, fmt, ##args); \
|
||||
closelog(); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define FLOG_DEBUG(fmt, args...) DO_LOG(LOG_DEBUG, fmt, ##args)
|
||||
#define FLOG_INFO(fmt, args...) DO_LOG(LOG_INFO, fmt, ##args)
|
||||
@@ -94,6 +94,8 @@ extern int verbose;
|
||||
int makepath (char *path);
|
||||
void ifconfig (char *ifname, char *addr, char *mask, int up);
|
||||
|
||||
int atonum (char *str);
|
||||
|
||||
pid_t pidfile_read (char *pidfile);
|
||||
pid_t pidfile_poll (char *cmd, char *path);
|
||||
|
||||
|
||||
Reference in new issue
Block a user