diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-05 01:04:11 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-05 02:04:13 +0100 |
commit | 2ed669b5b1da77e80fff6dc2f72f11e266479a8c (patch) | |
tree | 511a122e0935121c3025fc62dc0de377b9644c6c | |
parent | 4ddc6192b9ba2b0df88e17378cd0e3f67d3b04a4 (diff) | |
download | hurd-2ed669b5b1da77e80fff6dc2f72f11e266479a8c.tar.gz hurd-2ed669b5b1da77e80fff6dc2f72f11e266479a8c.tar.bz2 hurd-2ed669b5b1da77e80fff6dc2f72f11e266479a8c.zip |
Fix warnings
* libdiskfs/boot-start.c (diskfs_start_bootstrap): Fix printf format.
* libfshelp/delegate.c: Include <alloca.h> and <stdlib.h>.
* libfshelp/start-translator-long.c: Include <stdlib.h>.
* libshouldbeinlibc/ugids-verify-auth.c (server_verify_make_auth): Fix
prototypes for password_check_group and password_check_user.
* libstore/argp.c: Include <stdlib.h>.
* libstore/task.c: Include <stdlib.h>.
* exec/exec.c: Include <mach/vm_param.h>.
* libbpf/bpf_impl.c: Include <stdlib.h>.
* proc/info.c (S_proc_getloginpids): Remove local variables leader_task
and leader_sub.
* proc/main.c (main): Remove local variable original_argv.
* boot/boot.c (task_died, S_mach_notify_new_task): Fix printf format.
* exec/elfcore.c: Include <alloca.h> and <mach/vm_param.h>.
* trans/crash.c: Include <hurd/msg.h>.
* trans/random.c: Include <signal.h>.
* utils/login.c: Include <signal.h>.
* utils/id.c: Include <hurd/msg.h>.
* utils/devprobe.c: Include <stdlib.h>.
* utils/addauth.c: Include <hurd/msg.h>.
* utils/frobauth-mod.c: Include <hurd/msg.h>.
* utils/storeread.c: Include <stdlib.h>.
* utils/msgport.c: Include <hurd/msg.h>.
* sutils/clookup.c (file_name_lookup_carefully): Fix lookup function
prototype, make head and tail const.
* utils/rpcscan.c: Include <stdlib.h>.
* sutils/bless.c: Include <stdlib.h>.
* fstests/fstests.c: Include <stdlib.h>.
* startup/startup.c (argz_task_insert_right): Fix printf format.
* init/init.c: Include <stdlib.h>.
-rw-r--r-- | boot/boot.c | 4 | ||||
-rw-r--r-- | exec/elfcore.c | 2 | ||||
-rw-r--r-- | exec/exec.c | 1 | ||||
-rw-r--r-- | fstests/fstests.c | 1 | ||||
-rw-r--r-- | init/init.c | 1 | ||||
-rw-r--r-- | libbpf/bpf_impl.c | 1 | ||||
-rw-r--r-- | libdiskfs/boot-start.c | 2 | ||||
-rw-r--r-- | libfshelp/delegate.c | 2 | ||||
-rw-r--r-- | libfshelp/start-translator-long.c | 1 | ||||
-rw-r--r-- | libshouldbeinlibc/ugids-verify-auth.c | 4 | ||||
-rw-r--r-- | libstore/argp.c | 1 | ||||
-rw-r--r-- | libstore/task.c | 1 | ||||
-rw-r--r-- | proc/info.c | 2 | ||||
-rw-r--r-- | proc/main.c | 1 | ||||
-rw-r--r-- | startup/startup.c | 2 | ||||
-rw-r--r-- | sutils/bless.c | 1 | ||||
-rw-r--r-- | sutils/clookup.c | 4 | ||||
-rw-r--r-- | trans/crash.c | 1 | ||||
-rw-r--r-- | trans/random.c | 1 | ||||
-rw-r--r-- | utils/addauth.c | 1 | ||||
-rw-r--r-- | utils/devprobe.c | 1 | ||||
-rw-r--r-- | utils/frobauth-mod.c | 1 | ||||
-rw-r--r-- | utils/ids.c | 1 | ||||
-rw-r--r-- | utils/login.c | 1 | ||||
-rw-r--r-- | utils/msgport.c | 1 | ||||
-rw-r--r-- | utils/rpcscan.c | 1 | ||||
-rw-r--r-- | utils/storeread.c | 1 |
27 files changed, 30 insertions, 11 deletions
diff --git a/boot/boot.c b/boot/boot.c index 35577a89..22319757 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -2016,7 +2016,7 @@ static void task_died (mach_port_t name) { if (verbose > 1) - fprintf (stderr, "Task '%u' died.\r\n", name); + fprintf (stderr, "Task '%lu' died.\r\n", name); hurd_ihash_remove (&task_ihash, (hurd_ihash_key_t) name); } @@ -2034,7 +2034,7 @@ S_mach_notify_new_task (mach_port_t notify, return EOPNOTSUPP; if (verbose > 1) - fprintf (stderr, "Task '%u' created by task '%u'.\r\n", task, parent); + fprintf (stderr, "Task '%lu' created by task '%lu'.\r\n", task, parent); err = mach_port_request_notification (mach_task_self (), task, MACH_NOTIFY_DEAD_NAME, 0, diff --git a/exec/elfcore.c b/exec/elfcore.c index 2dd499bf..5f489a1e 100644 --- a/exec/elfcore.c +++ b/exec/elfcore.c @@ -27,6 +27,7 @@ #include <sys/utsname.h> #include <sys/procfs.h> #include <stddef.h> +#include <alloca.h> #define ELF_CLASS PASTE (ELFCLASS, __ELF_NATIVE_CLASS) #define PASTE(a, b) PASTE_1 (a, b) @@ -40,6 +41,7 @@ #endif #include <mach/thread_status.h> +#include <mach/vm_param.h> #include <assert-backtrace.h> #ifdef i386_THREAD_STATE diff --git a/exec/exec.c b/exec/exec.c index e9590911..b03c7fdb 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -25,6 +25,7 @@ #include "priv.h" #include <mach/gnumach.h> +#include <mach/vm_param.h> #include <hurd.h> #include <hurd/exec.h> #include <sys/stat.h> diff --git a/fstests/fstests.c b/fstests/fstests.c index c71b13ad..80b76cf2 100644 --- a/fstests/fstests.c +++ b/fstests/fstests.c @@ -29,6 +29,7 @@ #include <errno.h> #include <error.h> #include <unistd.h> +#include <stdlib.h> int check_refs (mach_port_t port) /* To call from gdb */ { diff --git a/init/init.c b/init/init.c index c8078dd3..93e0470a 100644 --- a/init/init.c +++ b/init/init.c @@ -25,6 +25,7 @@ #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> +#include <stdlib.h> #include <version.h> const char *argp_program_version = STANDARD_HURD_VERSION (init); diff --git a/libbpf/bpf_impl.c b/libbpf/bpf_impl.c index a419123a..6eb9dda3 100644 --- a/libbpf/bpf_impl.c +++ b/libbpf/bpf_impl.c @@ -37,6 +37,7 @@ #include <arpa/inet.h> #include <string.h> +#include <stdlib.h> #include <mach.h> #include <hurd.h> diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c index 01548548..ce999db1 100644 --- a/libdiskfs/boot-start.c +++ b/libdiskfs/boot-start.c @@ -248,7 +248,7 @@ diskfs_start_bootstrap () while (err == KERN_NAME_EXISTS); diskfs_kernel_task = MACH_PORT_NULL; - len = snprintf (buf, sizeof buf, "--kernel-task=%d", kernel_task_name); + len = snprintf (buf, sizeof buf, "--kernel-task=%lu", kernel_task_name); assert_backtrace (len < sizeof buf); /* Insert as second argument. */ err = argz_insert (&exec_argv, &exec_argvlen, diff --git a/libfshelp/delegate.c b/libfshelp/delegate.c index a44310f0..d8a9e497 100644 --- a/libfshelp/delegate.c +++ b/libfshelp/delegate.c @@ -19,6 +19,8 @@ #include <errno.h> #include <string.h> +#include <alloca.h> +#include <stdlib.h> #include <argz.h> #include <hurd.h> #include <hurd/fsys.h> diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c index 707b59ef..3a0a115b 100644 --- a/libfshelp/start-translator-long.c +++ b/libfshelp/start-translator-long.c @@ -24,6 +24,7 @@ #include <mach.h> #include <errno.h> #include <unistd.h> +#include <stdlib.h> #include <fcntl.h> #include <stdint.h> #include <string.h> diff --git a/libshouldbeinlibc/ugids-verify-auth.c b/libshouldbeinlibc/ugids-verify-auth.c index f6991aa2..ad28d49e 100644 --- a/libshouldbeinlibc/ugids-verify-auth.c +++ b/libshouldbeinlibc/ugids-verify-auth.c @@ -66,9 +66,9 @@ server_verify_make_auth (const char *password, auth_t auth; struct svma_state *svma_state = hook; /* Mig routines don't use 'const' for passwd. */ - error_t (*check) (io_t server, uid_t id, char *passwd, auth_t *auth) = + error_t (*check) (io_t server, uid_t id, const char *passwd, auth_t *auth) = is_group ? password_check_group : password_check_user; - error_t err = (*check) (svma_state->server, id, (char *) password, &auth); + error_t err = (*check) (svma_state->server, id, password, &auth); if (! err) /* PASSWORD checked out ok; the corresponding authentication is in AUTH. */ diff --git a/libstore/argp.c b/libstore/argp.c index a9c7fbd6..a399b48f 100644 --- a/libstore/argp.c +++ b/libstore/argp.c @@ -19,6 +19,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ #include <string.h> +#include <stdlib.h> #include <assert-backtrace.h> #include <hurd.h> #include <argp.h> diff --git a/libstore/task.c b/libstore/task.c index ea1475c8..bd029400 100644 --- a/libstore/task.c +++ b/libstore/task.c @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <hurd.h> diff --git a/proc/info.c b/proc/info.c index 6ab9f3fa..0c77c622 100644 --- a/proc/info.c +++ b/proc/info.c @@ -868,8 +868,6 @@ S_proc_getloginpids (struct proc *callerp, /* Relay it to the Subhurd's proc server (if any). */ error_t err; pid_t pid_sub; - pid_t leader_sub; - task_t leader_task; /* Release global lock while talking to the other proc server. */ pthread_mutex_unlock (&global_lock); diff --git a/proc/main.c b/proc/main.c index 0a6f9916..371e0461 100644 --- a/proc/main.c +++ b/proc/main.c @@ -157,7 +157,6 @@ main (int argc, char **argv, char **envp) void *genport; process_t startup_port; mach_port_t startup; - char **original_argv; struct argp argp = { options, parse_opt, 0, "Hurd process server" }; argp_parse (&argp, argc, argv, 0, 0, 0); diff --git a/startup/startup.c b/startup/startup.c index 9a06f7c2..3679ebc9 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -465,7 +465,7 @@ argz_task_insert_right (char **argz, size_t *argz_len, task_t task, } while (err == KERN_NAME_EXISTS); - if (asprintf (&arg, "--%s=%d", argument, name) < 0) + if (asprintf (&arg, "--%s=%lu", argument, name) < 0) return errno; err = argz_add (argz, argz_len, arg); diff --git a/sutils/bless.c b/sutils/bless.c index 4b272adc..cefdf7a8 100644 --- a/sutils/bless.c +++ b/sutils/bless.c @@ -20,6 +20,7 @@ #include <argp.h> #include <assert-backtrace.h> #include <error.h> +#include <stdlib.h> #include <hurd.h> #include <mach.h> #include <version.h> diff --git a/sutils/clookup.c b/sutils/clookup.c index 0232b634..97a04b51 100644 --- a/sutils/clookup.c +++ b/sutils/clookup.c @@ -51,12 +51,12 @@ file_name_lookup_carefully (const char *name, int flags, mode_t mode) sure the result node doesn't have a passive translator with no active translator started (but we make an exception for symlinks) -- if it does, we just return ENXIO. */ - error_t lookup (file_t dir, char *name, int flags, mode_t mode, + error_t lookup (file_t dir, const char *name, int flags, mode_t mode, retry_type *retry, string_t retry_name, mach_port_t *node) { error_t err; - char *head, *tail; + const char *head, *tail; char *slash = index (name, '/'); if (slash) diff --git a/trans/crash.c b/trans/crash.c index 3fad4992..aceebf07 100644 --- a/trans/crash.c +++ b/trans/crash.c @@ -24,6 +24,7 @@ #include <hurd.h> #include <fcntl.h> #include <hurd/trivfs.h> +#include <hurd/msg.h> #include <sys/wait.h> #include <error.h> #include <argp.h> diff --git a/trans/random.c b/trans/random.c index f48cea53..76b780bc 100644 --- a/trans/random.c +++ b/trans/random.c @@ -37,6 +37,7 @@ #include <sys/mman.h> #include <sys/stat.h> #include <unistd.h> +#include <signal.h> #include <version.h> #include "mach_debug_U.h" diff --git a/utils/addauth.c b/utils/addauth.c index 0932a33f..83d66b62 100644 --- a/utils/addauth.c +++ b/utils/addauth.c @@ -27,6 +27,7 @@ #include <ugids.h> #include <error.h> #include <hurd.h> +#include <hurd/msg.h> #include <version.h> #include "frobauth.h" diff --git a/utils/devprobe.c b/utils/devprobe.c index 69b15b29..d16e2161 100644 --- a/utils/devprobe.c +++ b/utils/devprobe.c @@ -19,6 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdio.h> +#include <stdlib.h> #include <fcntl.h> #include <argp.h> diff --git a/utils/frobauth-mod.c b/utils/frobauth-mod.c index 4464c18c..68cad134 100644 --- a/utils/frobauth-mod.c +++ b/utils/frobauth-mod.c @@ -23,6 +23,7 @@ #include <unistd.h> #include <string.h> #include <hurd.h> +#include <hurd/msg.h> #include <error.h> #include "frobauth.h" diff --git a/utils/ids.c b/utils/ids.c index f8ad22c5..e8bee57d 100644 --- a/utils/ids.c +++ b/utils/ids.c @@ -27,6 +27,7 @@ #include <error.h> #include <ugids.h> #include <version.h> +#include <hurd/msg.h> const char *argp_program_version = STANDARD_HURD_VERSION (ids); diff --git a/utils/login.c b/utils/login.c index 8d0cf92a..b70ee8ad 100644 --- a/utils/login.c +++ b/utils/login.c @@ -34,6 +34,7 @@ #include <assert-backtrace.h> #include <version.h> #include <sys/mman.h> +#include <signal.h> #include <netinet/in.h> #include <arpa/inet.h> diff --git a/utils/msgport.c b/utils/msgport.c index 06b7dc37..accdb644 100644 --- a/utils/msgport.c +++ b/utils/msgport.c @@ -21,6 +21,7 @@ 02111-1307, USA. */ #include <hurd.h> +#include <hurd/msg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/utils/rpcscan.c b/utils/rpcscan.c index 3ddf791a..c5a8addc 100644 --- a/utils/rpcscan.c +++ b/utils/rpcscan.c @@ -30,6 +30,7 @@ #include <inttypes.h> #include <stdbool.h> #include <stddef.h> +#include <stdlib.h> #include <argz.h> #include "msgids.h" diff --git a/utils/storeread.c b/utils/storeread.c index df381bec..2586a8c2 100644 --- a/utils/storeread.c +++ b/utils/storeread.c @@ -21,6 +21,7 @@ #include <argp.h> #include <error.h> #include <unistd.h> +#include <stdlib.h> #include <hurd.h> #include <sys/fcntl.h> #include <sys/mman.h> |