summaryrefslogtreecommitdiffstats
path: root/utils/update-alternatives.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:09 +0000
commit3c05da1bdef2a6e2142b4fcac974e7e3fc0db93c (patch)
tree9532e637f47d6ff7246ccbabb62d4e2b4b5908df /utils/update-alternatives.c
parentAdding debian version 1.22.6. (diff)
downloaddpkg-3c05da1bdef2a6e2142b4fcac974e7e3fc0db93c.tar.xz
dpkg-3c05da1bdef2a6e2142b4fcac974e7e3fc0db93c.zip
Merging upstream version 1.22.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--utils/update-alternatives.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 7d21a4d..9909cde 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -380,7 +380,7 @@ areadlink(const char *linkname)
/* Read it and terminate the string properly */
size = readlink(linkname, buf, st.st_size);
- if (size == -1) {
+ if (size < 0) {
int saved_errno = errno;
free(buf);
@@ -400,13 +400,13 @@ spawn(const char *prog, const char *args[])
int status;
pid = fork();
- if (pid == -1)
+ if (pid < 0)
error(_("fork failed"));
if (pid == 0) {
execvp(prog, (char *const *)args);
syserr(_("unable to execute %s (%s)"), prog, prog);
}
- while ((dead_pid = waitpid(pid, &status, 0)) == -1 && errno == EINTR) ;
+ while ((dead_pid = waitpid(pid, &status, 0)) < 0 && errno == EINTR) ;
if (dead_pid != pid)
error(_("wait for subprocess %s failed"), prog);
@@ -1530,7 +1530,7 @@ alternative_load(struct alternative *a, enum altdb_flags flags)
}
/* Verify the alternative is not empty. */
- if (fstat(fileno(ctx.fh), &st) == -1)
+ if (fstat(fileno(ctx.fh), &st) < 0)
syserr(_("cannot stat file '%s'"), ctx.filename);
if (st.st_size == 0) {
altdb_context_free(&ctx);
@@ -1958,7 +1958,7 @@ alternative_path_classify(const char *linkname)
{
struct stat st;
- if (fsys_lstat(linkname, &st) == -1) {
+ if (fsys_lstat(linkname, &st) < 0) {
if (errno != ENOENT)
syserr(_("cannot stat file '%s%s'"), instdir, linkname);
return ALT_PATH_MISSING;