From fd9daeb22fb9bb41f3fc516b63d33816cdb59bee Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Mon, 20 Apr 2026 23:39:42 +0200 Subject: [PATCH] Clean up nwdbm, nwroute and trustee warnings --- src/nwdbm.c | 29 +++++++++++++++-------------- src/nwroute.c | 6 +++--- src/trustee.c | 26 +++++++++++++------------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/nwdbm.c b/src/nwdbm.c index d18ace5..d1c178a 100644 --- a/src/nwdbm.c +++ b/src/nwdbm.c @@ -1800,7 +1800,7 @@ static void add_pr_queue(uint32 q_id, if (!q_directory || !*q_directory) { q_directory=buf; - sprintf(q_directory, "SYS:SYSTEM/%08lX.QDR", q_id); + sprintf(q_directory, "SYS:SYSTEM/%08X.QDR", q_id); } XDPRINTF((2,0, "ADD Q=%s, V=%s, C=%s", q_name, q_directory, q_command)); nw_new_obj_prop(q_id, NULL, 0, 0, 0, @@ -2001,7 +2001,7 @@ static uint8 *test_add_dir(uint8 *unixname, uint8 *pp, int flags, else { chmod(unixname, permiss); if (uid >-1 && gid > -1) - chown(unixname, uid, gid); + (void)chown(unixname, uid, gid); XDPRINTF((1, 0, "Created dir '%s'", unixname)); } } else { @@ -2018,7 +2018,7 @@ static uint8 *test_add_dir(uint8 *unixname, uint8 *pp, int flags, if (flags&2) { chmod(unixname, permiss); if (uid >-1 && gid > -1) - chown(unixname, uid, gid); + (void)chown(unixname, uid, gid); } } if (flags&1) { @@ -2108,7 +2108,7 @@ static void correct_user_dirs(uint32 objid, uint8 *objname, int uid, int gid) else downstr(p1+5); unlink(fndir); - symlink(buf1, fndir); + (void)symlink(buf1, fndir); } void test_ins_unx_user(uint32 id) @@ -2185,8 +2185,9 @@ static void check_compress_bindery() NETOBJ *obj=(NETOBJ*)data.dptr; if (NULL == bsearch(&obj->id, objs, (size_t)ocount, (size_t)sizeof(uint32), cmp_uint32)) { - errorp(10, errstr, "bsearch failed at id 0x%lx.", - (unsigned long)obj->id); + errorp(10, errstr, "bsearch failed at id 0x%x.", + obj->id); + dbmclose(); return; } @@ -2207,7 +2208,7 @@ static void check_compress_bindery() NETPROP *prop=(NETPROP*)data.dptr; if (NULL == bsearch(&prop->obj_id, objs, (size_t)ocount, (size_t)sizeof(uint32), cmp_uint32)) { - XDPRINTF((1,0, "will delete property %s for obj_id 0x%lx", + XDPRINTF((1,0, "will delete property %s for obj_id 0x%x", prop->name, prop->obj_id)); if (d_pcount == LOC_MAX_OBJS) break; d_prop_oid[d_pcount] = prop->obj_id; @@ -3049,7 +3050,7 @@ static void bcreate_obj(uint32 id, char *name, int type, /* 1/mstover -> ../id/1/2/3/4 */ slprintf(buf1,sizeof(buf1)-1, "../id/%s", id_buf); - symlink(buf1, buf); + (void)symlink(buf1, buf); /* id/1/2/3/4 creat */ len = slprintf(buf, sizeof(buf)-2,"%s/id/%s", path_bindery, id_buf); @@ -3062,17 +3063,17 @@ static void bcreate_obj(uint32 id, char *name, int type, strmaxcpy(buf+len, "name.o", sizeof(buf)-1-len); strmaxcpy(buf1, name, sizeof(buf1)-1); downstr(buf1); - symlink(buf1, buf); + (void)symlink(buf1, buf); /* typ -> 1 */ strmaxcpy(buf+len, "typ.o", sizeof(buf)-1-len); slprintf(buf1, sizeof(buf1)-1,"%x", type); - symlink(buf1, buf); + (void)symlink(buf1, buf); /* flags & security */ strmaxcpy(buf+len, "f+s.o", sizeof(buf)-1-len); slprintf(buf1, sizeof(buf1)-1,"%02x%02x", flags&0xff, security&0xff); - symlink(buf1, buf); + (void)symlink(buf1, buf); } @@ -3117,7 +3118,7 @@ static void bcreate_prop(uint32 id, int prop_id, char *name, /* id.p -> name */ slprintf(buf1,sizeof(buf1)-1, "%s", name); downstr(buf1); - symlink(buf1, buf); + (void)symlink(buf1, buf); /* x/name creat */ @@ -3131,7 +3132,7 @@ static void bcreate_prop(uint32 id, int prop_id, char *name, /* flags & security */ strmaxcpy(buf+len, "f+s", sizeof(buf)-1-len); slprintf(buf1, sizeof(buf1)-1,"%02x%02x", propflags&0xff, propsecurity&0xff); - symlink(buf1, buf); + (void)symlink(buf1, buf); } @@ -3180,7 +3181,7 @@ static void bcreate_val(uint32 id, int prop_id, int segment, sprintf(p1, "%02x", (int) *p++); p1+=2; } - symlink(buf1, buf); + (void)symlink(buf1, buf); } diff --git a/src/nwroute.c b/src/nwroute.c index 5eb95c1..20d1f4f 100644 --- a/src/nwroute.c +++ b/src/nwroute.c @@ -645,7 +645,7 @@ void print_routing_info(int force) uint8 frname[30]; NW_NET_DEVICE *nd=net_devices[k]; (void) get_frame_name(frname, nd->frame); - fprintf(f, "%-15s %-15s %5d %08lX %s\n", + fprintf(f, "%-15s %-15s %5d %08X %s\n", nd->devname, frname, nd->ticks, nd->net, (!nd->is_up) ? "DOWN" : ( (nd->is_up==1) ? "UP" @@ -667,7 +667,7 @@ void print_routing_info(int force) while (++k < anz_routes) { NW_ROUTES *nr = nw_routes[k]; if (nr->net) { - fprintf(f, "%08lX %4d %5d %08lX %02x:%02x:%02x:%02x:%02x:%02x\n", + fprintf(f, "%08X %4d %5d %08X %02x:%02x:%02x:%02x:%02x:%02x\n", nr->net, nr->hops, nr->ticks, nr->rnet, (int)nr->rnode[0], (int)nr->rnode[1], (int)nr->rnode[2], (int)nr->rnode[3], (int)nr->rnode[4], (int)nr->rnode[5]); @@ -691,7 +691,7 @@ void print_routing_info(int force) if (ns->typ) { char sname[50]; strmaxcpy(sname, ns->name, 20); - fprintf(f, "%-20s %4x %08lX %4d %s\n", sname, ns->typ, + fprintf(f, "%-20s %4x %08X %4d %s\n", sname, ns->typ, ns->net, ns->hops, xvisable_ipx_adr(&(ns->addr), 1)); } } /* while */ diff --git a/src/trustee.c b/src/trustee.c index 8420e11..e25ab60 100644 --- a/src/trustee.c +++ b/src/trustee.c @@ -398,10 +398,10 @@ static int del_trustee_from_disk(int volume, dev_t dev, ino_t inode, uint32 id) (int) buf_uc[2], (int) buf_uc[3], (unsigned int)id); - seteuid(0); + (void)seteuid(0); if (!unlink(buf)) result=0; - reseteuid(); + (void)reseteuid(); return(result); } @@ -423,12 +423,12 @@ unsigned int tru_vol_sernum(int volume, int mode) } if (mode) { if (++sernum==MAX_U32) sernum=1; - seteuid(0); + (void)seteuid(0); unlink(buf); slprintf(buf1, sizeof(buf1)-1, "%x", sernum); if (symlink(buf1, buf)) errorp(0, "rw_trustee_sernum", "symlink %s %s failed", buf1, buf); - reseteuid(); + (void)reseteuid(); tru_free_cache(volume); } return(sernum); @@ -449,12 +449,12 @@ void tru_free_file_trustees_from_disk(int volume, int dev, ino_t inode) (int) buf_uc[1], (int) buf_uc[2]); slprintf(buf+len, sizeof(buf) - len -1, "t.%x", (int)buf_uc[3]); - seteuid(0); + (void)seteuid(0); unx_xrmdir(buf); /* now we remove the name of the dir/file */ slprintf(buf+len, sizeof(buf) -len -1, "n.%x", (int)buf_uc[3]); unlink(buf); - reseteuid(); + (void)reseteuid(); } int tru_del_trustee(int volume, uint8 *unixname, struct stat *stb, uint32 id) @@ -601,7 +601,7 @@ static int local_tru_add_trustee_set(int volume, uint8 *unixname, int volumenamelen = get_volume_unixnamlen(volume); uint8 ufnbuf[2]; uint8 *ufn; - seteuid(0); + (void)seteuid(0); while (count--) { if (! ((own_eff_rights & TRUSTEE_S) || (act_id_flags&1)) ) { /* only user with TRUSTEE_S are allowed to set TRUSTEE_S */ @@ -614,7 +614,7 @@ static int local_tru_add_trustee_set(int volume, uint8 *unixname, nwoic->id, nwoic->trustee, volume, unixname, -result); }) if (result){ - reseteuid(); + (void)reseteuid(); goto func_err; } nwoic++; @@ -626,7 +626,7 @@ static int local_tru_add_trustee_set(int volume, uint8 *unixname, *(ufn+1)='\0'; } creat_trustee_path(volume, stb->st_dev, stb->st_ino, ufn); - reseteuid(); + (void)reseteuid(); #if 0 /* now in tru_add_trustee_set */ tru_vol_sernum(volume, 1); /* trustee sernum needs updated */ #endif @@ -652,7 +652,7 @@ int tru_add_trustee_set(int volume, uint8 *unixname, char *p = unixname+len; char *volp = unixname+vollen; - seteuid(0); + (void)seteuid(0); while (--p > volp) { if (*p == '/') { struct stat statb; @@ -675,7 +675,7 @@ int tru_add_trustee_set(int volume, uint8 *unixname, *p='/'; } } - reseteuid(); + (void)reseteuid(); tru_vol_sernum(volume, 1); /* trustee sernum needs updated */ } return (result); @@ -715,9 +715,9 @@ int tru_set_inherited_mask(int volume, uint8 *unixname, FILE_TRUSTEE_NODE *tr=find_trustee_node(volume, stb->st_dev, stb->st_ino); if (tr && (!(tr->mode_flags&0x1e) || !act_uid)) { int result; - seteuid(0); + (void)seteuid(0); result=put_trustee_to_disk(volume, stb->st_dev, stb->st_ino, 0L, new_mask); - reseteuid(); + (void)reseteuid(); if (!result) tru_vol_sernum(volume, 1); /* trustee sernum needs updated */ return(result);