From: Kees van Reeuwijk Date: Thu, 1 Apr 2010 13:25:05 +0000 (+0000) Subject: Fix printfs with too few or too many parms, remove unused vars, fix incorrect flag... X-Git-Tag: v3.1.7~183 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=fc7dced1fa0c632021c2473b703fba987057d58e;p=minix.git Fix printfs with too few or too many parms, remove unused vars, fix incorrect flag tests, other code cleanup. --- diff --git a/boot/bootimage.c b/boot/bootimage.c index 6c3ab3590..2e3754cfe 100644 --- a/boot/bootimage.c +++ b/boot/bootimage.c @@ -424,7 +424,7 @@ static void restore_screen(void) sizeof(boot_tty_info)); if(boot_tty_info.magic == TTYMAGIC) { - if(boot_tty_info.flags & (BTIF_CONSORIGIN|BTIF_CONSCURSOR) == + if((boot_tty_info.flags & (BTIF_CONSORIGIN|BTIF_CONSCURSOR)) == (BTIF_CONSORIGIN|BTIF_CONSCURSOR)) { int line; raw_copy(mon2abs(consolescreen), diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index 0941b8d64..0c7d918cd 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -1307,7 +1307,6 @@ int main(int argc, char **argv) /* Driver task. */ message m; - sigset_t set; int r; /* Initialize SEF. */ diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index 1feccf415..73851cfea 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -260,15 +260,15 @@ PRIVATE void do_conf(const message * mp) } } else { /* Port number is out of range */ port = ENXIO; + dep = NULL; } reply_mess.m_type = DL_CONF_REPLY; reply_mess.m3_i1 = port; reply_mess.m3_i2 = DE_PORT_NR; - /* FIXME: if port number is out of range, this uses - * uninitialized variable 'dep'. - */ - *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address; + if(dep != NULL){ + *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address; + } if (send(mp->m_source, &reply_mess) != OK) panic(str_SendErrMsg, mp->m_source); @@ -291,7 +291,7 @@ PRIVATE void do_get_name(message *mp) PRIVATE void do_reply(dpeth_t * dep, int err, int may_block) { message reply; - int status = FALSE; + int status = 0; if (dep->de_flags & DEF_ACK_SEND) status |= DL_PACK_SEND; if (dep->de_flags & DEF_ACK_RECV) status |= DL_PACK_RECV; @@ -620,7 +620,6 @@ PRIVATE void de_first_init(dpeth_t *dep) int i,j,r; vir_bytes descr_vir = dep->sendrecv_descr_buf; vir_bytes buffer_vir = dep->sendrecv_buf; - de_descr_t *phys_descr; de_loc_descr_t *loc_descr; u32_t temp; diff --git a/drivers/orinoco/hermes.c b/drivers/orinoco/hermes.c index a33dd9176..39996d76e 100644 --- a/drivers/orinoco/hermes.c +++ b/drivers/orinoco/hermes.c @@ -624,8 +624,8 @@ int hermes_read_ltv (hermes_t * hw, int bap, u16_t rid, unsigned bufsize, if (rtype != rid) { printf("hermes @ %lx: hermes_read_ltv(): rid (0x%04x)", - hw->iobase); - printf("does not match type (0x%04x)\n", rid, rtype); + hw->iobase, rid); + printf("does not match type (0x%04x)\n", rtype); } if (HERMES_RECLEN_TO_BYTES (rlength) > bufsize) { diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1089a791e..ef00eab09 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1168,7 +1168,7 @@ int devind; /*===========================================================================* * record_bars * *===========================================================================*/ -PRIVATE void record_bars(devind, last_reg) +PRIVATE void record_bars(int devind, int last_reg) { int i, reg, width; @@ -2397,7 +2397,7 @@ int port; port); #if USER_SPACE if (OK != (s=sys_outl(PCII_CONFADD, PCII_UNSEL))) - printf("PCI: warning, sys_outl failed: %d\n"); + printf("PCI: warning, sys_outl failed: %d\n", s); #else outl(PCII_CONFADD, PCII_UNSEL); #endif @@ -2514,7 +2514,7 @@ u32_t value; port, value); #if USER_SPACE if (OK != (s=sys_outl(PCII_CONFADD, PCII_UNSEL))) - printf("PCI: warning, sys_outl failed: %d\n"); + printf("PCI: warning, sys_outl failed: %d\n",s); #else outl(PCII_CONFADD, PCII_UNSEL); #endif @@ -2523,8 +2523,7 @@ u32_t value; /*===========================================================================* * pcii_rsts * *===========================================================================*/ -PRIVATE u16_t pcii_rsts(busind) -int busind; +PRIVATE u16_t pcii_rsts(int busind) { u16_t v; int s; diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index dfee1dddb..0c537841e 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -263,7 +263,7 @@ _PROTOTYPE( static void check_int_events, (void) ); _PROTOTYPE( static void do_hard_int, (void) ); _PROTOTYPE( static void rtl8169_dump, (void) ); _PROTOTYPE( static void dump_phy, (re_t *rep) ); -_PROTOTYPE( static int rl_handler, (re_t *rep) ); +_PROTOTYPE( static void rl_handler, (re_t *rep) ); _PROTOTYPE( static void rl_watchdog_f, (timer_t *tp) ); /* @@ -1989,8 +1989,7 @@ static void do_hard_int(void) /*===========================================================================* * rl_handler * *===========================================================================*/ -static int rl_handler(rep) -re_t *rep; +static void rl_handler(re_t *rep) { int i, port, tx_head, tx_tail, link_up; u16_t isr; @@ -2093,8 +2092,6 @@ re_t *rep; if (isr) printf("rl_handler: unhandled interrupt isr = 0x%04x\n", isr); - - return 1; } /*===========================================================================* diff --git a/drivers/sb16/mixer/sb16_mixer.c b/drivers/sb16/mixer/sb16_mixer.c index e64d1bf36..cff70fdce 100644 --- a/drivers/sb16/mixer/sb16_mixer.c +++ b/drivers/sb16/mixer/sb16_mixer.c @@ -328,10 +328,10 @@ PRIVATE int get_set_input(const message *m_ptr, int flag, int channel) mixer_set(input_cmd, mask); } else { /* Get input */ if (shift > 0) { - input.left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF); - input.right = (((mask >> shift) & 1) == 1 ? ON : OFF); + input.left = ((((mask >> (shift+1)) & 1) == 1) ? ON : OFF); + input.right = ((((mask >> shift) & 1) == 1) ? ON : OFF); } else { - input.left = ((mask & 1) == 1 ? ON : OFF); + input.left = (((mask & 1) == 1) ? ON : OFF); } /* Copy back to user */ @@ -384,10 +384,10 @@ PRIVATE int get_set_output(const message *m_ptr, int flag) mixer_set(MIXER_OUTPUT_CTRL, mask); } else { /* Get input */ if (shift > 0) { - output.left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF); - output.right = (((mask >> shift) & 1) == 1 ? ON : OFF); + output.left = ((((mask >> (shift+1)) & 1) == 1) ? ON : OFF); + output.right = ((((mask >> shift) & 1) == 1) ? ON : OFF); } else { - output.left = ((mask & 1) == 1 ? ON : OFF); + output.left = (((mask & 1) == 1) ? ON : OFF); } /* Copy back to user */ diff --git a/drivers/ti1225/ti1225.c b/drivers/ti1225/ti1225.c index 61c2a06e9..5783497c8 100644 --- a/drivers/ti1225/ti1225.c +++ b/drivers/ti1225/ti1225.c @@ -440,7 +440,7 @@ struct port *pp; v8= pci_attr_r8(devind, TI_CARD_CTRL); if (v8 & TI_CCR_IFG) { - printf("ti1225: got functional interrupt\n", v8); + printf("ti1225: got functional interrupt\n"); pci_attr_w8(devind, TI_CARD_CTRL, v8); } diff --git a/kernel/arch/i386/breakpoints.c b/kernel/arch/i386/breakpoints.c index 176ae609a..6cffe8ed6 100644 --- a/kernel/arch/i386/breakpoints.c +++ b/kernel/arch/i386/breakpoints.c @@ -49,7 +49,7 @@ printf("ld_dr7(0x%x)\n",dr7); case 3: ld_dr3(linaddr); break; default: panic(__FILE__, "invalid breakpoint index", __LINE__); } -printf("ld_dr%d(0x%x, 0x%x)\n",bp,linaddr); +printf("ld_dr%d(0x%x)\n",bp,linaddr); /* set new flags */ dr7 |= dr7flags; diff --git a/kernel/system/do_clear.c b/kernel/system/do_clear.c index 31682b36d..0e85a764d 100644 --- a/kernel/system/do_clear.c +++ b/kernel/system/do_clear.c @@ -32,7 +32,7 @@ PUBLIC int do_clear(struct proc * caller, message * m_ptr) rc = proc_addr(exit_p); /* clean up */ /* Don't clear if already cleared. */ - if(isemptyp(rc)) return; + if(isemptyp(rc)) return OK; /* Check the table with IRQ hooks to see if hooks should be released. */ for (i=0; i < NR_IRQ_HOOKS; i++) { diff --git a/kernel/system/do_update.c b/kernel/system/do_update.c index ef43407cd..f38f7205d 100644 --- a/kernel/system/do_update.c +++ b/kernel/system/do_update.c @@ -35,14 +35,12 @@ PUBLIC int do_update(struct proc * caller, message * m_ptr) */ endpoint_t src_e, dst_e; int src_p, dst_p; - struct proc *src_rp, *dst_rp, *rp; + struct proc *src_rp, *dst_rp; struct priv *src_privp, *dst_privp; struct proc orig_src_proc; struct proc orig_dst_proc; struct priv orig_src_priv; struct priv orig_dst_priv; - int r; - reg_t src_vbp, dst_vbp; /* Lookup slots for source and destination process. */ src_e = m_ptr->SYS_UPD_SRC_ENDPT; diff --git a/kernel/system/do_vmctl.c b/kernel/system/do_vmctl.c index 136b20b55..5d091d402 100644 --- a/kernel/system/do_vmctl.c +++ b/kernel/system/do_vmctl.c @@ -21,7 +21,6 @@ PUBLIC int do_vmctl(struct proc * caller, message * m_ptr) int proc_nr; endpoint_t ep = m_ptr->SVMCTL_WHO; struct proc *p, *rp, *target; - int err; if(ep == SELF) { ep = m_ptr->m_source; } diff --git a/lib/libc/ansi/misc.c b/lib/libc/ansi/misc.c index 42333e055..2ea0b88a6 100644 --- a/lib/libc/ansi/misc.c +++ b/lib/libc/ansi/misc.c @@ -206,7 +206,7 @@ date_of(const register struct dsttype *dst, const struct tm *timep) if (dst->ds_type != 'M') { return dst->ds_date[0] - - (dst->ds_type == 'J' + ((dst->ds_type == 'J') && leap && dst->ds_date[0] < 58); } diff --git a/lib/libdriver/driver.c b/lib/libdriver/driver.c index 5b9a88e4f..7a8a5c693 100644 --- a/lib/libdriver/driver.c +++ b/lib/libdriver/driver.c @@ -385,7 +385,7 @@ message *mp; /*===========================================================================* * nop_prepare * *===========================================================================*/ -PUBLIC struct device *nop_prepare(device) +PUBLIC struct device *nop_prepare(int device) { /* Nothing to prepare for. */ return(NIL_DEV); diff --git a/servers/hgfs/hgfs_server/main.c b/servers/hgfs/hgfs_server/main.c index 78c212d6b..794a60874 100644 --- a/servers/hgfs/hgfs_server/main.c +++ b/servers/hgfs/hgfs_server/main.c @@ -92,9 +92,6 @@ sef_init_info_t *info; *===========================================================================*/ PRIVATE void sef_cb_signal_handler(int signo) { - sigset_t set; - int r; - /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; diff --git a/servers/is/dmp_kernel.c b/servers/is/dmp_kernel.c index 642747b05..3a370cdf8 100644 --- a/servers/is/dmp_kernel.c +++ b/servers/is/dmp_kernel.c @@ -61,8 +61,7 @@ PUBLIC struct boot_image image[NR_BOOT_PROCS]; PUBLIC void timing_dmp() { static struct util_timingdata timingdata[TIMING_CATEGORIES]; - int r, c, f, skipped = 0, printed = 0, maxlines = 23, x = 0; - static int offsetlines = 0; + int r, c, x = 0; if ((r = sys_getlocktimings(&timingdata[0])) != OK) { printf("IS: warning: couldn't get copy of lock timings: %d\n", r); @@ -213,7 +212,7 @@ PRIVATE char *boot_flags_str(int flags) *===========================================================================*/ PUBLIC void image_dmp() { - int m, i,j,r; + int m, r; struct boot_image *ip; if ((r = sys_getimage(image)) != OK) { @@ -315,7 +314,7 @@ PUBLIC void privileges_dmp() register struct proc *rp; static struct proc *oldrp = BEG_PROC_ADDR; register struct priv *sp; - int r, i, n = 0; + int r, i; /* First obtain a fresh copy of the current process and system table. */ if ((r = sys_getprivtab(priv)) != OK) { @@ -381,7 +380,7 @@ PUBLIC void proctab_dmp() register struct proc *rp; static struct proc *oldrp = BEG_PROC_ADDR; - int r, n = 0; + int r; phys_clicks text, data, size; /* First obtain a fresh copy of the current process table. */ @@ -418,7 +417,7 @@ PUBLIC void procstack_dmp() register struct proc *rp; static struct proc *oldrp = BEG_PROC_ADDR; - int r, n = 0; + int r; /* First obtain a fresh copy of the current process table. */ if ((r = sys_getproctab(proc)) != OK) { @@ -441,7 +440,7 @@ PUBLIC void memmap_dmp() { register struct proc *rp; static struct proc *oldrp = proc; - int r, n = 0; + int r; phys_clicks size; /* First obtain a fresh copy of the current process table. */ diff --git a/servers/is/main.c b/servers/is/main.c index cc8e0c374..ce38d0116 100644 --- a/servers/is/main.c +++ b/servers/is/main.c @@ -37,7 +37,6 @@ PUBLIC int main(int argc, char **argv) * sending the reply. The loop never terminates, unless a panic occurs. */ int result; - sigset_t sigset; /* SEF local startup. */ env_setargs(argc, argv); @@ -97,7 +96,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the information server. */ diff --git a/servers/iso9660fs/cache.c b/servers/iso9660fs/cache.c index 990aa190d..b9cca4933 100644 --- a/servers/iso9660fs/cache.c +++ b/servers/iso9660fs/cache.c @@ -28,7 +28,6 @@ PUBLIC struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in PUBLIC struct buf *get_block(block) register block_t block; /* which block is wanted? */ { - int b; register struct buf *bp, *free_bp; free_bp = NIL_BUF; diff --git a/servers/iso9660fs/device.c b/servers/iso9660fs/device.c index 9afc6c459..647560103 100644 --- a/servers/iso9660fs/device.c +++ b/servers/iso9660fs/device.c @@ -41,7 +41,6 @@ void **buf; int *vec_grants; vir_bytes bytes; { - int size; int j; iovec_t *v; static iovec_t new_iovec[NR_IOREQS]; @@ -170,10 +169,8 @@ int bytes; /* how many bytes to transfer */ int flags; /* special flags, like O_NONBLOCK */ { /* Read or write from a device. The parameter 'dev' tells which one. */ - struct dmap *dp; int r, safe; message m; - iovec_t *v; cp_grant_id_t gid = GRANT_INVALID; int vec_grants; int op_used; diff --git a/servers/iso9660fs/main.c b/servers/iso9660fs/main.c index a3fb0cd25..c1c18270d 100644 --- a/servers/iso9660fs/main.c +++ b/servers/iso9660fs/main.c @@ -20,7 +20,6 @@ FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) ); *===========================================================================*/ PUBLIC int main(void) { endpoint_t who_e, ind, error; - message m; /* SEF local startup. */ sef_local_startup(); diff --git a/servers/iso9660fs/path.c b/servers/iso9660fs/path.c index a19e36786..202fedbef 100644 --- a/servers/iso9660fs/path.c +++ b/servers/iso9660fs/path.c @@ -16,7 +16,7 @@ FORWARD _PROTOTYPE( int parse_path, (ino_t dir_ino, ino_t root_ino, int flags, *===========================================================================*/ PUBLIC int fs_lookup() { cp_grant_id_t grant; - int r, r1, len, flags; + int r, len, flags; size_t offset; ino_t dir_ino, root_ino; struct dir_record *dir; @@ -87,8 +87,8 @@ PUBLIC int search_dir(ldir_ptr,string,numb) ino_t *numb; /* pointer to new dir record */ { struct dir_record *dir_tmp; - register struct buf *bp,*bp2; - int pos,len; + register struct buf *bp; + int pos; char* comma_pos = NULL; char tmp_string[NAME_MAX]; @@ -293,8 +293,7 @@ struct dir_record **resp; /* resulting inode */ */ register struct dir_record *rip = NULL; - int r, inumb; - dev_t mnt_dev; + int r; ino_t numb; /* If 'string' is empty, yield same inode straight away. */ diff --git a/servers/iso9660fs/read.c b/servers/iso9660fs/read.c index 789eade94..960ba0217 100644 --- a/servers/iso9660fs/read.c +++ b/servers/iso9660fs/read.c @@ -80,8 +80,7 @@ PUBLIC int fs_bread(void) int nrbytes; u64_t position; unsigned int off, cum_io; - mode_t mode_word; - int completed, r2 = OK; + int completed; struct dir_record *dir; r = OK; @@ -292,9 +291,7 @@ int *completed; /* number of bytes copied */ register struct buf *bp; register int r = OK; - int n; block_t b; - dev_t dev; int file_unit, rel_block, offset; *completed = 0; diff --git a/servers/iso9660fs/stadir.c b/servers/iso9660fs/stadir.c index c3ded5a98..d29d18fb3 100644 --- a/servers/iso9660fs/stadir.c +++ b/servers/iso9660fs/stadir.c @@ -25,8 +25,7 @@ PRIVATE int stat_dir_record( /* Common code for stat and fstat system calls. */ struct stat statbuf; - mode_t mo; - int r, s; + int r; struct tm ltime; time_t time1; diff --git a/servers/mfs/device.c b/servers/mfs/device.c index faf2b700d..f81aea977 100644 --- a/servers/mfs/device.c +++ b/servers/mfs/device.c @@ -54,7 +54,6 @@ void **buf; int *vec_grants; vir_bytes bytes; { - int access = 0, size; int j; iovec_t *v; static iovec_t *new_iovec; @@ -158,10 +157,8 @@ int bytes; /* how many bytes to transfer */ int flags; /* special flags, like O_NONBLOCK */ { /* Read or write from a device. The parameter 'dev' tells which one. */ - struct dmap *dp; int r, safe; message m; - iovec_t *v; cp_grant_id_t gid = GRANT_INVALID; int vec_grants; int op_used; diff --git a/servers/mfs/inode.c b/servers/mfs/inode.c index 7c314e4e0..27a65b9eb 100644 --- a/servers/mfs/inode.c +++ b/servers/mfs/inode.c @@ -128,7 +128,7 @@ int numb; /* inode number (ANSI: may not be unshort) */ /* Find the inode in the hash table. If it is not there, get a free inode * load it from the disk if it's necessary and put on the hash list */ - register struct inode *rip, *xp; + register struct inode *rip; int hashi; hashi = numb & INODE_HASH_MASK; diff --git a/servers/mfs/main.c b/servers/mfs/main.c index d24758b9b..5acc79658 100644 --- a/servers/mfs/main.c +++ b/servers/mfs/main.c @@ -28,7 +28,6 @@ PUBLIC int main(int argc, char *argv[]) * sending the reply. The loop never terminates, unless a panic occurs. */ int error, ind; - message m; /* SEF local startup. */ env_setargs(argc, argv); diff --git a/servers/mfs/mount.c b/servers/mfs/mount.c index 24a4ab6f8..12d893309 100644 --- a/servers/mfs/mount.c +++ b/servers/mfs/mount.c @@ -23,7 +23,6 @@ PUBLIC int fs_readsuper() * so that the VFS knows that it has to find the vnode on which this FS * process' partition is mounted on. */ - struct super_block *xp; struct inode *root_ip; cp_grant_id_t label_gid; size_t label_len; @@ -152,7 +151,6 @@ PUBLIC int fs_mountpoint() PUBLIC int fs_unmount() { /* Unmount a file system by device number. */ - struct super_block *sp1; int count; struct inode *rip, *root_ip; diff --git a/servers/mfs/open.c b/servers/mfs/open.c index c07e34318..44abd8930 100644 --- a/servers/mfs/open.c +++ b/servers/mfs/open.c @@ -21,7 +21,7 @@ FORWARD _PROTOTYPE( struct inode *new_node, (struct inode *ldirp, PUBLIC int fs_create() { phys_bytes len; - int r, b; + int r; struct inode *ldirp; struct inode *rip; mode_t omode; diff --git a/servers/mfs/path.c b/servers/mfs/path.c index d5268b281..531d24927 100644 --- a/servers/mfs/path.c +++ b/servers/mfs/path.c @@ -67,7 +67,6 @@ PUBLIC int fs_lookup() if(user_path[len - 1] != '\0') return(EINVAL); if(flags & PATH_GET_UCRED) { /* Do we have to copy uid/gid credentials? */ - int i; grant2 = fs_m_in.REQ_GRANT2; cred_size = fs_m_in.REQ_UCRED_SIZE; diff --git a/servers/mfs/protect.c b/servers/mfs/protect.c index 4a451d986..6d4d5c4ef 100644 --- a/servers/mfs/protect.c +++ b/servers/mfs/protect.c @@ -17,7 +17,6 @@ PUBLIC int fs_chmod() /* Perform the chmod(name, mode) system call. */ register struct inode *rip; - register int r; /* Temporarily open the file. */ if( (rip = get_inode(fs_dev, fs_m_in.REQ_INODE_NR)) == NIL_INODE) @@ -78,7 +77,6 @@ PUBLIC int forbidden(register struct inode *rip, mode_t access_desired) */ register struct inode *old_rip = rip; - register struct super_block *sp; register mode_t bits, perm_bits; int r, shift; diff --git a/servers/mfs/read.c b/servers/mfs/read.c index e7f794287..cfcce9006 100644 --- a/servers/mfs/read.c +++ b/servers/mfs/read.c @@ -22,7 +22,7 @@ PRIVATE char getdents_buf[GETDENTS_BUFSIZ]; PUBLIC int fs_readwrite(void) { int r, rw_flag, chunk, block_size, block_spec; - int partial_cnt, regular, nrbytes; + int regular, nrbytes; cp_grant_id_t gid; off_t position, f_size, bytes_left; unsigned int off, cum_io; @@ -140,8 +140,7 @@ PUBLIC int fs_breadwrite(void) int nrbytes; u64_t position; unsigned int off, cum_io; - mode_t mode_word; - int completed, r2 = OK; + int completed; /* Pseudo inode for rw_chunk */ struct inode rip; diff --git a/servers/mfs/write.c b/servers/mfs/write.c index a19e5b91b..7a66f52f7 100644 --- a/servers/mfs/write.c +++ b/servers/mfs/write.c @@ -291,7 +291,6 @@ off_t position; /* file pointer */ zone_t z; zone_t zone_size; int scale, r; - struct super_block *sp; /* Is another block available in the current zone? */ if ( (b = read_map(rip, position)) == NO_BLOCK) { diff --git a/servers/pfs/inode.c b/servers/pfs/inode.c index 0544e8611..90626f026 100644 --- a/servers/pfs/inode.c +++ b/servers/pfs/inode.c @@ -127,7 +127,7 @@ int numb; /* inode number (ANSI: may not be unshort) */ /* Find the inode in the hash table. If it is not there, get a free inode * load it from the disk if it's necessary and put on the hash list */ - register struct inode *rip, *xp; + register struct inode *rip; int hashi; hashi = numb & INODE_HASH_MASK; @@ -245,7 +245,6 @@ PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits) /* Allocate a free inode on 'dev', and return a pointer to it. */ register struct inode *rip; - int major, minor; bit_t b; ino_t i_num; @@ -293,8 +292,6 @@ register struct inode *rip; /* the inode to be erased */ * inode is to be truncated. */ - register int i; - rip->i_size = 0; rip->i_update = ATIME | CTIME | MTIME; /* update all times later */ } diff --git a/servers/pfs/link.c b/servers/pfs/link.c index 12c8285ee..71208f560 100644 --- a/servers/pfs/link.c +++ b/servers/pfs/link.c @@ -1,8 +1,5 @@ #include "fs.h" -#include #include -#include -#include #include "buf.h" #include "inode.h" #include @@ -14,7 +11,6 @@ PUBLIC int fs_ftrunc(void) { struct inode *rip; off_t start, end; - int r; ino_t inumb; inumb = fs_m_in.REQ_INODE_NR; @@ -43,7 +39,6 @@ off_t newsize; /* inode must become this size */ * O_APPEND mode, as this is different per fd and is checked when * writing is done. */ - int scale; /* Pipes can shrink, so adjust size to make sure all zones are removed. */ if(newsize != 0) return(EINVAL); /* Only truncate pipes to 0. */ diff --git a/servers/pfs/main.c b/servers/pfs/main.c index 16b1ffdd8..efcb48503 100644 --- a/servers/pfs/main.c +++ b/servers/pfs/main.c @@ -25,7 +25,6 @@ PUBLIC int main(int argc, char *argv[]) * sending the reply. The loop never terminates, unless a panic occurs. */ int error, ind; - message m; /* SEF local startup. */ env_setargs(argc, argv); diff --git a/servers/pfs/read.c b/servers/pfs/read.c index 215b35f71..bd763abe4 100644 --- a/servers/pfs/read.c +++ b/servers/pfs/read.c @@ -12,7 +12,6 @@ PUBLIC int fs_readwrite(void) { int r, rw_flag; - block_t b; struct buf *bp; cp_grant_id_t gid; off_t position, f_size; diff --git a/servers/pm/exec.c b/servers/pm/exec.c index 77198ce6b..350d0e6f7 100644 --- a/servers/pm/exec.c +++ b/servers/pm/exec.c @@ -40,7 +40,6 @@ PUBLIC int do_exec() { message m; - int r; /* Forward call to FS */ m.m_type = PM_EXEC; diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index dc29656da..3406296c2 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -47,7 +47,7 @@ PUBLIC int do_fork() register struct mproc *rmc; /* pointer to child */ pid_t new_pid; static int next_child; - int i, n = 0, r, s; + int i, n = 0, s; endpoint_t child_ep; message m; @@ -133,7 +133,7 @@ PUBLIC int do_srv_fork() int s; pid_t new_pid; static int next_child; - int i, n = 0, r; + int i, n = 0; endpoint_t child_ep; message m; @@ -243,7 +243,7 @@ int dump_core; /* flag indicating whether to dump core */ * become a zombie. */ register int proc_nr, proc_nr_e; - int parent_waiting, r; + int r; pid_t procgrp; struct mproc *p_mp; clock_t user_time, sys_time; diff --git a/servers/pm/getset.c b/servers/pm/getset.c index a2da959d7..498e73619 100644 --- a/servers/pm/getset.c +++ b/servers/pm/getset.c @@ -22,7 +22,7 @@ PUBLIC int do_get() */ register struct mproc *rmp = mp; - int r, proc; + int r; int ngroups; switch(call_nr) { diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 7a5d60ab7..06bf30535 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -366,7 +366,6 @@ PUBLIC int do_getepinfo() PUBLIC int do_reboot() { message m; - int r; /* Check permission to abort the system. */ if (mp->mp_effuid != SUPER_USER) return(EPERM); diff --git a/servers/pm/signal.c b/servers/pm/signal.c index 84b0cafe5..53d30d1f5 100644 --- a/servers/pm/signal.c +++ b/servers/pm/signal.c @@ -213,9 +213,7 @@ PUBLIC int do_srv_kill() /*===========================================================================* * process_ksig * *===========================================================================*/ -PUBLIC int process_ksig(proc_nr_e, signo) -int proc_nr_e; -int signo; +PUBLIC int process_ksig(int proc_nr_e, int signo) { register struct mproc *rmp; int proc_nr; @@ -223,14 +221,14 @@ int signo; if(pm_isokendpt(proc_nr_e, &proc_nr) != OK || proc_nr < 0) { printf("PM: process_ksig: %d?? not ok\n", proc_nr_e); - return; + return EDEADSRCDST; /* process is gone. */ } rmp = &mproc[proc_nr]; if ((rmp->mp_flags & (IN_USE | EXITING)) != IN_USE) { #if 0 printf("PM: process_ksig: %d?? exiting / not in use\n", proc_nr_e); #endif - return; + return EDEADSRCDST; /* process is gone. */ } proc_id = rmp->mp_pid; mp = &mproc[0]; /* pretend signals are from PM */ @@ -615,7 +613,7 @@ struct mproc *rmp; /* which process */ * so it can check for READs and WRITEs from pipes, ttys and the like. */ message m; - int r, slot; + int r; /* If we're already waiting for a delayed call, don't do anything now. */ if (rmp->mp_flags & DELAY_CALL) diff --git a/servers/rs/exec.c b/servers/rs/exec.c index 741cf50be..cda1ae715 100644 --- a/servers/rs/exec.c +++ b/servers/rs/exec.c @@ -34,7 +34,6 @@ int srv_execve(int proc_e, char *exec, size_t exec_len, char **argv, size_t string_off; size_t n; int ov; - message m; int r; /* Assumptions: size_t and char *, it's all the same thing. */ @@ -161,7 +160,7 @@ static int do_exec(int proc_e, char *exec, size_t exec_len, char *progname, proc_e, (vir_bytes) vsp, (phys_bytes)frame_len); if (r != OK) { printf("RS: stack_top is 0x%lx; tried to copy to 0x%lx in %d\n", - stack_top, vsp); + stack_top, vsp, proc_e); printf("do_exec: copying out new stack failed: %d\n", r); error= r; goto fail; @@ -298,7 +297,6 @@ vir_bytes *pc; /* program entry point (initial PC) */ int *hdrlenp; { /* Read the header and extract the text, data, bss and total sizes from it. */ - block_t b; struct exec hdr; /* a.out header is read in here */ /* Read the header and check the magic number. The standard MINIX header @@ -327,8 +325,6 @@ int *hdrlenp; * used here only. The symbol table is for the benefit of a debugger and * is ignored here. */ - int r; - if (exec_len < sizeof(hdr)) return(ENOEXEC); memcpy(&hdr, exec, sizeof(hdr)); @@ -413,7 +409,6 @@ phys_bytes seg_bytes; /* how much is to be transferred? */ */ int r; - off_t n, o, b_off, seg_off; if (off+seg_bytes > exec_len) return ENOEXEC; r= sys_vircopy(SELF, D, (vir_bytes)exec+off, proc_e, seg, 0, seg_bytes); diff --git a/servers/rs/main.c b/servers/rs/main.c index e7fdea351..3630b338d 100644 --- a/servers/rs/main.c +++ b/servers/rs/main.c @@ -479,8 +479,6 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) *===========================================================================*/ PRIVATE void sef_cb_signal_handler(int signo) { - int exit_status; - /* Check for known signals, ignore anything else. */ switch(signo) { case SIGCHLD: @@ -508,13 +506,15 @@ PRIVATE int sef_cb_signal_manager(endpoint_t target, int signo) if(rs_verbose) printf("RS: ignoring spurious signal %d for process %d\n", signo, target); - return; + return OK; /* Since we're ignoring it, we have handled + * the signal without problem. All is OK. + */ } rp = rproc_ptr[target_p]; rpub = rp->r_pub; /* Don't bother if a termination signal has already been processed. */ - if( rp->r_flags & (RS_TERMINATED|RS_EXITING) == RS_TERMINATED ) { + if(rp->r_flags & RS_TERMINATED) { return EDEADSRCDST; /* process is gone */ } diff --git a/servers/rs/manager.c b/servers/rs/manager.c index 39dc03fcd..157097a1f 100644 --- a/servers/rs/manager.c +++ b/servers/rs/manager.c @@ -268,7 +268,6 @@ PUBLIC void end_update(int result) * service has a period, a status request will be forced in the next period. */ struct rproc *old_rp, *new_rp, *exiting_rp, *surviving_rp; - message m; old_rp = rupdate.rp; new_rp = old_rp->r_new_rp; @@ -316,8 +315,6 @@ char *errstr; int err; { /* Crash a system service and don't let it restart. */ - struct rprocpub *rpub; - if(errstr && !shutting_down) { printf("RS: %s (error %d)\n", errstr, err); } @@ -383,12 +380,8 @@ struct rproc *rp; /* Create the given system service. */ int child_proc_nr_e, child_proc_nr_n; /* child process slot */ pid_t child_pid; /* child's process id */ - char *file_only; - int s, use_copy, slot_nr; - bitchunk_t *vm_mask; - message m; + int s, use_copy; extern char **environ; - char * null_env = NULL; struct rprocpub *rpub; rpub = rp->r_pub; @@ -879,11 +872,63 @@ PUBLIC void terminate_service(struct rproc *rp) } } +/*===========================================================================* + * run_script * + *===========================================================================*/ +PRIVATE int run_script(struct rproc *rp) +{ + int r, endpoint; + pid_t pid; + char *reason; + char incarnation_str[20]; /* Enough for a counter? */ + char *envp[1] = { NULL }; + struct rprocpub *rpub; + + rpub = rp->r_pub; + if (rp->r_flags & RS_REFRESHING) + reason= "restart"; + else if (rp->r_flags & RS_NOPINGREPLY) + reason= "no-heartbeat"; + else reason= "crashed"; + sprintf(incarnation_str, "%d", rp->r_restarts); + + if(rs_verbose) { + printf("RS: %s:\n", srv_to_string(rp)); + printf("RS: calling script '%s'\n", rp->r_script); + printf("RS: reason: '%s'\n", reason); + printf("RS: incarnation: '%s'\n", incarnation_str); + } + + pid= fork(); + switch(pid) + { + case -1: + return kill_service(rp, "unable to fork script", errno); + case 0: + execle(rp->r_script, rp->r_script, rpub->label, reason, + incarnation_str, NULL, envp); + printf("RS: run_script: execl '%s' failed: %s\n", + rp->r_script, strerror(errno)); + exit(1); + default: + /* Set the privilege structure for the child process. */ + endpoint = getnprocnr(pid); + if ((r = sys_privctl(endpoint, SYS_PRIV_SET_USER, NULL)) + != OK) { + return kill_service(rp,"can't set script privileges",r); + } + /* Allow the script to run. */ + if ((r = sys_privctl(endpoint, SYS_PRIV_ALLOW, NULL)) != OK) { + return kill_service(rp,"can't let the script run",r); + } + } + return OK; +} + /*===========================================================================* * restart_service * *===========================================================================*/ -PUBLIC void restart_service(rp) -struct rproc *rp; +PUBLIC void restart_service(struct rproc *rp) { /* Restart service via a recovery script or directly. */ struct rproc *replica_rp; @@ -1092,13 +1137,7 @@ endpoint_t source; { /* Initialize a slot as requested by the client. */ struct rprocpub *rpub; - int slot_nr; /* local table entry */ - int arg_count; /* number of arguments */ - char *cmd_ptr; /* parse command string */ char *label; /* unique name of command */ - enum dev_style dev_style; /* device style */ - struct rproc *tmp_rp; - struct rprocpub *tmp_rpub; int len; /* length of string */ int i; int s; @@ -1534,59 +1573,6 @@ struct rproc *rp; rproc_ptr[_ENDPOINT_P(rpub->endpoint)] = NULL; } -/*===========================================================================* - * run_script * - *===========================================================================*/ -PUBLIC int run_script(rp) -struct rproc *rp; -{ - int r, endpoint; - pid_t pid; - char *reason; - char incarnation_str[20]; /* Enough for a counter? */ - char *envp[1] = { NULL }; - struct rprocpub *rpub; - - rpub = rp->r_pub; - if (rp->r_flags & RS_REFRESHING) - reason= "restart"; - else if (rp->r_flags & RS_NOPINGREPLY) - reason= "no-heartbeat"; - else reason= "crashed"; - sprintf(incarnation_str, "%d", rp->r_restarts); - - if(rs_verbose) { - printf("RS: %s:\n", srv_to_string(rp)); - printf("RS: calling script '%s'\n", rp->r_script); - printf("RS: reason: '%s'\n", reason); - printf("RS: incarnation: '%s'\n", incarnation_str); - } - - pid= fork(); - switch(pid) - { - case -1: - return kill_service(rp, "unable to fork script", errno); - case 0: - execle(rp->r_script, rp->r_script, rpub->label, reason, - incarnation_str, NULL, envp); - printf("RS: run_script: execl '%s' failed: %s\n", - rp->r_script, strerror(errno)); - exit(1); - default: - /* Set the privilege structure for the child process. */ - endpoint = getnprocnr(pid); - if ((r = sys_privctl(endpoint, SYS_PRIV_SET_USER, NULL)) - != OK) { - return kill_service(rp,"can't set script privileges",r); - } - /* Allow the script to run. */ - if ((r = sys_privctl(endpoint, SYS_PRIV_ALLOW, NULL)) != OK) { - return kill_service(rp,"can't let the script run",r); - } - } -} - /*===========================================================================* * get_next_label * @@ -1617,7 +1603,7 @@ char *caller_label; if (len > RS_MAX_LABEL_LEN) { printf( - "rs:get_next_label: bad ipc list entry '.*s' for %s: too long\n", + "rs:get_next_label: bad ipc list entry '%.*s' for %s: too long\n", len, p, caller_label); continue; } diff --git a/servers/rs/proto.h b/servers/rs/proto.h index d73314e8b..c574e030d 100644 --- a/servers/rs/proto.h +++ b/servers/rs/proto.h @@ -75,7 +75,6 @@ _PROTOTYPE( struct rproc* lookup_slot_by_label, (char *label) ); _PROTOTYPE( struct rproc* lookup_slot_by_pid, (pid_t pid) ); _PROTOTYPE( int alloc_slot, (struct rproc **rpp) ); _PROTOTYPE( void free_slot, (struct rproc *rp) ); -_PROTOTYPE( int run_script, (struct rproc *rp) ); _PROTOTYPE( char *get_next_label, (char *ptr, char *label, char *caller_label)); _PROTOTYPE( void add_forward_ipc, (struct rproc *rp, struct priv *privp) ); _PROTOTYPE( void add_backward_ipc, (struct rproc *rp, struct priv *privp) ); diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 8f30e0ee1..8c105e555 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -827,7 +827,6 @@ PUBLIC void dev_up(int maj) struct vmnt *vmp; struct fproc *rfp; struct vnode *vp; - message m; /* Open a device once for every filp that's opened on it, * and once for every filesystem mounted from it. diff --git a/servers/vfs/link.c b/servers/vfs/link.c index a74da279e..8d62183be 100644 --- a/servers/vfs/link.c +++ b/servers/vfs/link.c @@ -30,7 +30,6 @@ PUBLIC int do_link() { /* Perform the link(name1, name2) system call. */ int r = OK; - endpoint_t linked_fs_e, link_lastdir_fs_e; struct vnode *vp, *vp_d; /* See if 'name1' (file to be linked to) exists. */ @@ -72,7 +71,6 @@ PUBLIC int do_unlink() * is almost the same. They differ only in some condition testing. Unlink() * may be used by the superuser to do dangerous things; rmdir() may not. */ - register struct fproc *rfp; struct vnode *vldirp, *vp; int r; @@ -126,7 +124,6 @@ PUBLIC int do_rename() { /* Perform the rename(name1, name2) system call. */ int r = OK, r1; - size_t len; struct vnode *old_dirp, *new_dirp, *vp; char old_name[PATH_MAX+1]; @@ -218,7 +215,6 @@ PUBLIC int do_truncate() PUBLIC int do_ftruncate() { /* As with do_truncate(), truncate_vnode() does the actual work. */ - int r; struct filp *rfilp; if ((off_t) m_in.flength < 0) return(EINVAL); @@ -255,9 +251,8 @@ off_t newsize; PUBLIC int do_slink() { /* Perform the symlink(name1, name2) system call. */ - int r, linklen; + int r; struct vnode *vp; - char string[NAME_MAX]; /* last component of the new dir's path name */ if(m_in.name1_length <= 1) return(ENOENT); if(m_in.name1_length >= SYMLINK_MAX) return(ENAMETOOLONG); diff --git a/servers/vfs/misc.c b/servers/vfs/misc.c index 2e33d7baf..ae6701ff6 100644 --- a/servers/vfs/misc.c +++ b/servers/vfs/misc.c @@ -151,8 +151,6 @@ PUBLIC int do_fcntl() register struct filp *f; int new_fd, r, fl; - long cloexec_mask; /* bit map for the FD_CLOEXEC flag */ - long clo_value; /* FD_CLOEXEC flag in proper position */ struct filp *dummy; /* Is the file descriptor valid? */ @@ -533,7 +531,7 @@ int ngroups; gid_t *groups; { struct fproc *rfp; - int slot, i; + int slot; okendpt(proc_e, &slot); rfp = &fproc[slot]; @@ -623,7 +621,7 @@ PUBLIC int pm_dumpcore(proc_e, seg_ptr) int proc_e; struct mem_map *seg_ptr; { - int r, proc_s; + int proc_s; /* Terminate the process */ okendpt(proc_e, &proc_s); diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index eb2434c1b..99ddc1c72 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -128,7 +128,6 @@ PRIVATE int mount_fs(endpoint_t fs_e) struct fproc *tfp; struct dmap *dp; dev_t dev; - message m; struct vnode *root_node, *vp = NULL, *bspec; struct vmnt *vmp; char *label; @@ -405,11 +404,10 @@ PUBLIC int unmount(dev, label) Dev_t dev; /* block-special device */ char *label; /* buffer to retrieve label, or NULL */ { - struct vnode *vp, *vi; + struct vnode *vp; struct vmnt *vmp_i = NULL, *vmp = NULL; struct dmap *dp; int count, r; - int fs_e; /* Find vmnt that is to be unmounted */ for(vmp_i = &vmnt[0]; vmp_i < &vmnt[NR_MNTS]; ++vmp_i) { @@ -496,7 +494,6 @@ int allow_mountpt; * and the path is the root node of a mounted file system, return that device * number. In all other cases, return NO_DEV and an error code in 'err_code'. */ - int r; dev_t dev; struct vnode *vp; @@ -522,7 +519,7 @@ int allow_mountpt; /*===========================================================================* * is_nonedev * *===========================================================================*/ -PRIVATE int is_nonedev(dev) +PRIVATE int is_nonedev(int dev) { /* Return whether the given device is a "none" pseudo device. */ diff --git a/servers/vfs/open.c b/servers/vfs/open.c index 2952f1604..9282e00a6 100644 --- a/servers/vfs/open.c +++ b/servers/vfs/open.c @@ -247,7 +247,6 @@ PRIVATE struct vnode *new_node(int oflags, mode_t bits) struct vnode *dirp, *vp; int r, flags; struct node_details res; - struct vnode *rest; /* When O_CREAT and O_EXCL flags are set, the path may not be named by a * symbolic link. */ diff --git a/servers/vfs/path.c b/servers/vfs/path.c index 1d2f65299..da89b86ac 100644 --- a/servers/vfs/path.c +++ b/servers/vfs/path.c @@ -111,7 +111,6 @@ PUBLIC struct vnode *last_dir(void) * and parse the path up to the penultimate component. */ - int r; size_t len; char *cp; char dir_entry[PATH_MAX+1]; diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index 1a1521976..12148c450 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -46,7 +46,6 @@ PUBLIC int do_pipe() struct filp *fil_ptr0, *fil_ptr1; int fil_des[2]; /* reply goes here */ struct vnode *vp; - struct vmnt *vmp; struct node_details res; /* See if a free vnode is available */ @@ -581,7 +580,7 @@ int proc_nr_e; *===========================================================================*/ PUBLIC int select_request_pipe(struct filp *f, int *ops, int block) { - int orig_ops, r = 0, err, canwrite; + int orig_ops, r = 0, err; orig_ops = *ops; if ((*ops & (SEL_RD|SEL_ERR))) { if ((err = pipe_check(f->filp_vno, READING, 0, diff --git a/servers/vfs/protect.c b/servers/vfs/protect.c index b72828c4f..10fa125e7 100644 --- a/servers/vfs/protect.c +++ b/servers/vfs/protect.c @@ -75,8 +75,6 @@ PUBLIC int do_chmod() PUBLIC int do_chown() { /* Perform the chmod(name, mode) and fchmod(fd, mode) system calls. */ - int inode_nr; - int fs_e; struct filp *flp; struct vnode *vp; int r; @@ -173,11 +171,10 @@ PUBLIC int forbidden(struct vnode *vp, mode_t access_desired) * if it is forbidden, EACCES is returned. */ - register struct super_block *sp; register mode_t bits, perm_bits; uid_t uid; gid_t gid; - int r, shift, type; + int r, shift; if (vp->v_uid == (uid_t) -1 || vp->v_gid == (gid_t) -1) return(EACCES); diff --git a/servers/vfs/read.c b/servers/vfs/read.c index 819805a3d..a1a377c8e 100644 --- a/servers/vfs/read.c +++ b/servers/vfs/read.c @@ -43,14 +43,11 @@ int rw_flag; /* READING or WRITING */ /* Perform read(fd, buffer, nbytes) or write(fd, buffer, nbytes) call. */ register struct filp *f; register struct vnode *vp; - off_t bytes_left; u64_t position, res_pos, new_pos; - unsigned int off, cum_io, cum_io_incr, res_cum_io; - int op, oflags, r, chunk, block_spec, char_spec; + unsigned int cum_io, cum_io_incr, res_cum_io; + int op, oflags, r, block_spec, char_spec; int regular; mode_t mode_word; - phys_bytes p; - struct dmap *dp; /* If the file descriptor is valid, get the vnode, size and mode. */ if (m_in.nbytes < 0) return(EINVAL); @@ -154,7 +151,6 @@ PUBLIC int do_getdents() /* Perform the getdents(fd, buf, size) system call. */ int r; u64_t new_pos; - cp_grant_id_t gid; register struct filp *rfilp; /* Is the file descriptor valid? */ @@ -191,10 +187,10 @@ struct filp *f; char *buf; size_t req_size; { - int r, oflags, partial_pipe = 0, r2; - size_t size, cum_io, cum_io_incr, cum_io_incr2; + int r, oflags, partial_pipe = 0; + size_t size, cum_io, cum_io_incr; struct vnode *vp; - u64_t position, new_pos, new_pos2; + u64_t position, new_pos; oflags = f->filp_flags; vp = f->filp_vno; diff --git a/servers/vfs/request.c b/servers/vfs/request.c index ef5f4aeab..9b0993e06 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -12,9 +12,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -1027,7 +1025,6 @@ PRIVATE int fs_sendrec_f(char *file, int line, endpoint_t fs_e, message *reqm) */ int r, old_driver_e, new_driver_e; message origm, m; - struct vmnt *vmp; if(fs_e <= 0 || fs_e == NONE) panic("talking to bogus endpoint: %d", fs_e); diff --git a/servers/vfs/select.c b/servers/vfs/select.c index e435b43a1..46880cdf7 100644 --- a/servers/vfs/select.c +++ b/servers/vfs/select.c @@ -714,7 +714,7 @@ PUBLIC void select_unsuspend_by_endpt(endpoint_t proc_e) *===========================================================================*/ PUBLIC void select_reply1() { - int i, s, minor, status; + int i, minor, status; endpoint_t driver_e; dev_t dev; struct filp *fp; diff --git a/servers/vfs/stadir.c b/servers/vfs/stadir.c index 7beffde92..30a0d6ce9 100644 --- a/servers/vfs/stadir.c +++ b/servers/vfs/stadir.c @@ -75,7 +75,6 @@ int len; /* length of the directory name string */ { /* Do the actual work for chdir() and chroot(). */ struct vnode *vp; - int r; /* Try to open the directory */ if (fetch_name(name_ptr, len, M3) != OK) return(err_code); diff --git a/servers/vfs/time.c b/servers/vfs/time.c index 3415ec689..7ee63e57b 100644 --- a/servers/vfs/time.c +++ b/servers/vfs/time.c @@ -22,7 +22,6 @@ PUBLIC int do_utime() /* Perform the utime(name, timep) system call. */ register int len; int r; - uid_t uid; time_t actime, modtime; struct vnode *vp; diff --git a/servers/vfs/utility.c b/servers/vfs/utility.c index 0a97a729f..02509c2b0 100644 --- a/servers/vfs/utility.c +++ b/servers/vfs/utility.c @@ -92,7 +92,7 @@ PUBLIC int isokendpt_f(char *file, int line, int endpoint, int *proc, int fatal) endpoint_t ke; *proc = _ENDPOINT_P(endpoint); if(endpoint == NONE) { - printf("vfs:%s: endpoint is NONE\n", file, line, endpoint); + printf("vfs:%s:%d: endpoint is NONE\n", file, line); failed = 1; } else if(*proc < 0 || *proc >= NR_PROCS) { printf("vfs:%s:%d: proc (%d) from endpoint (%d) out of range\n",