summaryrefslogtreecommitdiffstats
path: root/sys-utils/flock.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
commitc61e14d3a8412cd50d98aab604e607692c844c8a (patch)
tree4925aca0e6b64c8664ea2f3fdfa99a52dc93d5da /sys-utils/flock.c
parentAdding upstream version 2.39.3. (diff)
downloadutil-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.tar.xz
util-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.zip
Adding upstream version 2.40.upstream/2.40
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sys-utils/flock.c')
-rw-r--r--sys-utils/flock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys-utils/flock.c b/sys-utils/flock.c
index 6079920..fed29d7 100644
--- a/sys-utils/flock.c
+++ b/sys-utils/flock.c
@@ -49,7 +49,7 @@
static void __attribute__((__noreturn__)) usage(void)
{
fputs(USAGE_HEADER, stdout);
- printf(
+ fprintf(stdout,
_(" %1$s [options] <file>|<directory> <command> [<argument>...]\n"
" %1$s [options] <file>|<directory> -c <command>\n"
" %1$s [options] <file descriptor number>\n"),
@@ -70,8 +70,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_( " -F, --no-fork execute command without forking\n"), stdout);
fputs(_( " --verbose increase verbosity\n"), stdout);
fputs(USAGE_SEPARATOR, stdout);
- printf(USAGE_HELP_OPTIONS(26));
- printf(USAGE_MAN_TAIL("flock(1)"));
+ fprintf(stdout, USAGE_HELP_OPTIONS(26));
+ fprintf(stdout, USAGE_MAN_TAIL("flock(1)"));
exit(EXIT_SUCCESS);
}
@@ -138,7 +138,7 @@ int main(int argc, char *argv[])
int no_fork = 0;
int status;
int verbose = 0;
- struct timeval time_start, time_done;
+ struct timeval time_start = { 0 }, time_done = { 0 };
/*
* The default exit code for lock conflict or timeout
* is specified in man flock.1
@@ -327,7 +327,7 @@ int main(int argc, char *argv[])
if (have_timeout)
cancel_timer(&timer);
if (verbose) {
- struct timeval delta;
+ struct timeval delta = { 0 };
gettime_monotonic(&time_done);
timersub(&time_done, &time_start, &delta);