ccx-utils

Miscellaneous utilities written in C
git clone https://ccx.te2000.cz/git/ccx-utils
Log | Files | Refs

commit c4575987bbb77e7130864577cbf87ce5e6e39f1d
parent 605fe53d83cf728ca3bc6dfe2793119daaf6c9a5
Author: Jan Pobrislo <ccx@te2000.cz>
Date:   Mon, 29 Jul 2024 19:28:58 +0000

Fix warnings

Diffstat:
Msrc/applyuidgid-caps.c | 2+-
Msrc/nosuid.c | 2+-
Msrc/pidns_run.c | 3++-
Msrc/safelink.c | 8+++++---
Msrc/spawn-pty.c | 2+-
5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/applyuidgid-caps.c b/src/applyuidgid-caps.c @@ -10,7 +10,7 @@ #include <skalibs/types.h> #include <skalibs/setgroups.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/sgetopt.h> #include <skalibs/djbunix.h> #include <skalibs/exec.h> diff --git a/src/nosuid.c b/src/nosuid.c @@ -5,7 +5,7 @@ #include <skalibs/exec.h> #include <skalibs/djbunix.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #define USAGE "nosuid prog..." #define dieusage() strerr_dieusage(100, USAGE) diff --git a/src/pidns_run.c b/src/pidns_run.c @@ -5,10 +5,11 @@ #include <sys/wait.h> #include <sys/select.h> #include <assert.h> +#include <stdlib.h> /* exit() */ #include <skalibs/exec.h> #include <skalibs/djbunix.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #define PROG "pidns_run" diff --git a/src/safelink.c b/src/safelink.c @@ -1,15 +1,17 @@ #include <errno.h> /* for errno */ #include <fcntl.h> /* for mkdirat() openat() */ +#include <unistd.h> /* for linkat() */ +#include <stdio.h> /* for renameat() */ #include <stdbool.h> /* for bool */ -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/random.h> #define PROG "safelink" #define USAGE "safelink oldpath newpath" #define BUFLEN 260 -char* opendir_nofollow(char *pathname, int *fd, bool create_dirs) +const char* opendir_nofollow(const char *pathname, int *fd, bool create_dirs) { char next[BUFLEN]; int fd1, fd2; @@ -82,7 +84,7 @@ int main (int argc, char const *const *argv) strerr_dieusage(100, USAGE); } int old_fd, new_fd; - char *old_base, *new_base; + const char *old_base, *new_base; old_base = opendir_nofollow(argv[1], &old_fd, false); if(old_base[0] == 0) { strerr_dief2x(100, "malformed path: ", argv[1]); diff --git a/src/spawn-pty.c b/src/spawn-pty.c @@ -7,7 +7,7 @@ #include <skalibs/exec.h> #include <skalibs/djbunix.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #define PROG "spawn-pty" #define USAGE "spawn-pty term_name { pty-prog ... } ptmx-prog ..."