From adf0b6fb26d8970a0142c0adaad8a212e634b942 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Wed, 3 Mar 2010 15:47:16 +0000 Subject: [PATCH] No more E{SRC,DST}DIED errno's, replaced by EDEADSRCDST. The callers don't care about the difference and had to check 3 error codes instead of one. --- drivers/filter/driver.c | 3 +-- include/errno.h | 2 -- servers/iso9660fs/device.c | 6 +++--- servers/mfs/device.c | 6 +++--- servers/vfs/device.c | 4 +--- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/filter/driver.c b/drivers/filter/driver.c index 97afc6888..dd7c4af53 100644 --- a/drivers/filter/driver.c +++ b/drivers/filter/driver.c @@ -564,8 +564,7 @@ static int check_senda(int which) amp = &amsgtable[which]; - if ((amp->flags & AMF_DONE) && - (amp->result == EDEADSRCDST || amp->result == EDSTDIED)) { + if ((amp->flags & AMF_DONE) && (amp->result == EDEADSRCDST)) { return BD_DEAD; } diff --git a/include/errno.h b/include/errno.h index a6b6ac25a..3a252cae6 100644 --- a/include/errno.h +++ b/include/errno.h @@ -119,8 +119,6 @@ extern int errno; /* place where the error numbers go */ #define EDEADSRCDST (_SIGN 105) /* source or destination is not alive */ #define ENOTREADY (_SIGN 106) /* source or destination is not ready */ #define EBADREQUEST (_SIGN 107) /* destination cannot handle request */ -#define ESRCDIED (_SIGN 108) /* source just died */ -#define EDSTDIED (_SIGN 109) /* destination just died */ #define ETRAPDENIED (_SIGN 110) /* IPC trap not allowed */ #define EDONTREPLY (_SIGN 201) /* pseudo-code: don't send a reply */ diff --git a/servers/iso9660fs/device.c b/servers/iso9660fs/device.c index 0b8cf25cd..1c867a8cc 100644 --- a/servers/iso9660fs/device.c +++ b/servers/iso9660fs/device.c @@ -188,7 +188,7 @@ int flags; /* special flags, like O_NONBLOCK */ driver_e = driver_endpoints[(dev >> MAJOR) & BYTE].driver_e; /* See if driver is roughly valid. */ - if (driver_e == NONE) return(EDSTDIED); + if (driver_e == NONE) return(EDEADSRCDST); /* The io vector copying relies on this I/O being for FS itself. */ if(proc_e != SELF_E) { @@ -229,7 +229,7 @@ int flags; /* special flags, like O_NONBLOCK */ * - VFS sends the new driver endp for the FS proc and the request again */ if (r != OK) { - if (r == EDEADSRCDST || r == EDSTDIED || r == ESRCDIED) { + if (r == EDEADSRCDST) { printf("ISOFS(%d) dead driver %d\n", SELF_E, driver_e); driver_endpoints[(dev >> MAJOR) & BYTE].driver_e = NONE; return(r); @@ -302,7 +302,7 @@ message *mess_ptr; /* pointer to message for task */ r = sendrec(task_nr, mess_ptr); if (r != OK) { - if (r == EDEADSRCDST || r == EDSTDIED || r == ESRCDIED) { + if (r == EDEADSRCDST) { printf("fs: dead driver %d\n", task_nr); panic(__FILE__, "should handle crashed drivers", NO_NUM); diff --git a/servers/mfs/device.c b/servers/mfs/device.c index b42829179..668e18639 100644 --- a/servers/mfs/device.c +++ b/servers/mfs/device.c @@ -178,7 +178,7 @@ int flags; /* special flags, like O_NONBLOCK */ /* See if driver is roughly valid. */ if (driver_e == NONE) { printf("MFS(%d) block_dev_io: no driver for dev %x\n", SELF_E, dev); - return(EDSTDIED); + return(EDEADSRCDST); } /* The io vector copying relies on this I/O being for FS itself. */ @@ -220,7 +220,7 @@ int flags; /* special flags, like O_NONBLOCK */ * - VFS sends the new driver endp for the FS proc and the request again */ if (r != OK) { - if (r == EDEADSRCDST || r == EDSTDIED || r == ESRCDIED) { + if (r == EDEADSRCDST) { printf("MFS(%d) dead driver %d\n", SELF_E, driver_e); driver_endpoints[(dev >> MAJOR) & BYTE].driver_e = NONE; return r; @@ -329,7 +329,7 @@ message *mess_ptr; /* pointer to message for task */ r = sendrec(task_nr, mess_ptr); if (r != OK) { - if (r == EDEADSRCDST || r == EDSTDIED || r == ESRCDIED) { + if (r == EDEADSRCDST) { printf("fs: dead driver %d\n", task_nr); panic(__FILE__, "should handle crashed drivers", NO_NUM); diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 8ccb12b51..ddf980e96 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -158,8 +158,6 @@ PUBLIC void dev_status(message *m) if ((r = sendrec(m->m_source, &st)) != OK) { printf("DEV_STATUS failed to %d: %d\n", m->m_source, r); if (r == EDEADSRCDST) return; - if (r == EDSTDIED) return; - if (r == ESRCDIED) return; panic(__FILE__,"couldn't sendrec for DEV_STATUS", r); } @@ -619,7 +617,7 @@ message *mess_ptr; /* pointer to message for task */ proc_e = mess_ptr->IO_ENDPT; r = sendrec(task_nr, mess_ptr); if (r != OK) { - if (r == EDEADSRCDST || r == EDSTDIED || r == ESRCDIED) { + if (r == EDEADSRCDST) { printf("fs: dead driver %d\n", task_nr); dmap_unmap_by_endpt(task_nr); return(r); -- 2.44.0