From: Sami Kerola Date: Fri, 2 Nov 2012 17:50:52 +0000 (+0000) Subject: pgrep: fix compiler warnings X-Git-Tag: v3.3.6~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ba7f3abdb4edea1f3d0bb9d3d3944344ffadc33;p=procps-ng pgrep: fix compiler warnings pgrep.c:195:12: warning: 'fcntl_lock' defined but not used [-Wunused-function] pgrep.c:575:5: warning: no previous declaration for 'signal_option' [-Wmissing-declarations] Signed-off-by: Sami Kerola --- diff --git a/pgrep.c b/pgrep.c index 6cba9aa5..4938bc9d 100644 --- a/pgrep.c +++ b/pgrep.c @@ -187,23 +187,6 @@ static int strict_atol (const char *restrict str, long *restrict value) #include -/* Seen non-BSD code do this: - * - *if (fcntl_lock(pid_fd, F_SETLK, F_WRLCK, SEEK_SET, 0, 0) == -1) - * return -1; - */ -int fcntl_lock(int fd, int cmd, int type, int whence, int start, int len) -{ - struct flock lock[1]; - - lock->l_type = type; - lock->l_whence = whence; - lock->l_start = start; - lock->l_len = len; - - return fcntl(fd, cmd, lock); -} - /* We try a read lock. The daemon should have a write lock. * Seen using flock: FreeBSD code */ static int has_flock(int fd) @@ -572,7 +555,7 @@ static struct el * select_procs (int *num) return list; } -int signal_option(int *argc, char **argv) +static int signal_option(int *argc, char **argv) { int sig; int i;