From: Tomas Hruby Date: Mon, 25 Jan 2010 14:22:09 +0000 (+0000) Subject: 2 copies of taskcall.c removed X-Git-Tag: v3.1.6~43 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=ee4cff8d666d4cf065bb2e6f40d721e41aded7fd;p=minix.git 2 copies of taskcall.c removed - taskcall.c is 3x in the trunk as part of libc, libsysutil and libsys. It should be only part of libsys. - only system process should be linked with libsys, therefore using raw _taskcall() in service.c is replaced by _syscall() - the same for minix_rs.c - lib/other/sys_eniop.c can go without replacement as it is part of syslib --- diff --git a/lib/other/Makefile.in b/lib/other/Makefile.in index 7470dca7f..ccc64ba3b 100644 --- a/lib/other/Makefile.in +++ b/lib/other/Makefile.in @@ -88,11 +88,9 @@ libc_FILES=" \ strtok_r.c \ strtoll.c \ swab.c \ - sys_eniop.c \ syscall.c \ sysconf.c \ syslog.c \ - taskcall.c \ telldir.c \ termcap.c \ ttyname.c \ diff --git a/lib/other/minix_rs.c b/lib/other/minix_rs.c index 1361567cc..0e847fcc1 100644 --- a/lib/other/minix_rs.c +++ b/lib/other/minix_rs.c @@ -16,10 +16,10 @@ #include #include #include +#include int minix_rs_lookup(const char *name, endpoint_t *value) { - int r; message m; size_t len_key; @@ -28,12 +28,11 @@ int minix_rs_lookup(const char *name, endpoint_t *value) m.RS_NAME = (char *) name; m.RS_NAME_LEN = len_key; - r = _taskcall(RS_PROC_NR, RS_LOOKUP, &m); - - if(r == OK) { + if (_syscall(RS_PROC_NR, RS_LOOKUP, &m) != -1) { *value = m.RS_ENDPOINT; + return OK; } - return r; + return -1; } diff --git a/lib/other/sys_eniop.c b/lib/other/sys_eniop.c deleted file mode 100644 index f270006ad..000000000 --- a/lib/other/sys_eniop.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "../syslib/syslib.h" - -/*===========================================================================* - * sys_enable_iop * - *===========================================================================*/ -PUBLIC int sys_enable_iop(proc_nr_e) -endpoint_t proc_nr_e; /* number of process to allow I/O */ -{ - message m_iop; - m_iop.IO_ENDPT = proc_nr_e; - return _taskcall(SYSTASK, SYS_IOPENABLE, &m_iop); -} - - diff --git a/lib/other/taskcall.c b/lib/other/taskcall.c deleted file mode 100644 index 02ab258ca..000000000 --- a/lib/other/taskcall.c +++ /dev/null @@ -1,20 +0,0 @@ -/* _taskcall() is the same as _syscall() except it returns negative error - * codes directly and not in errno. This is a better interface for MM and - * FS. - */ - -#include -#include - -PUBLIC int _taskcall(who, syscallnr, msgptr) -endpoint_t who; -int syscallnr; -register message *msgptr; -{ - int status; - - msgptr->m_type = syscallnr; - status = _sendrec(who, msgptr); - if (status != 0) return(status); - return(msgptr->m_type); -} diff --git a/lib/sysutil/Makefile.in b/lib/sysutil/Makefile.in index 2680b4ee1..710a7b810 100644 --- a/lib/sysutil/Makefile.in +++ b/lib/sysutil/Makefile.in @@ -20,7 +20,6 @@ libsys_FILES=" \ fkey_ctl.c \ tsc_util.c \ report.c \ - taskcall.c \ read_tsc.s \ read_tsc_64.c \ ser_putc.c \ diff --git a/lib/sysutil/taskcall.c b/lib/sysutil/taskcall.c deleted file mode 100644 index 02ab258ca..000000000 --- a/lib/sysutil/taskcall.c +++ /dev/null @@ -1,20 +0,0 @@ -/* _taskcall() is the same as _syscall() except it returns negative error - * codes directly and not in errno. This is a better interface for MM and - * FS. - */ - -#include -#include - -PUBLIC int _taskcall(who, syscallnr, msgptr) -endpoint_t who; -int syscallnr; -register message *msgptr; -{ - int status; - - msgptr->m_type = syscallnr; - status = _sendrec(who, msgptr); - if (status != 0) return(status); - return(msgptr->m_type); -} diff --git a/servers/rs/service.c b/servers/rs/service.c index 8b1732c37..f84e62afe 100644 --- a/servers/rs/service.c +++ b/servers/rs/service.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -124,10 +125,10 @@ PRIVATE void print_usage(char *app_name, char *problem) /* A request to the RS server failed. Report and exit. */ -PRIVATE void failure(int num) +PRIVATE void failure(void) { - fprintf(stderr, "Request to RS failed: %s (error %d)\n", strerror(num), num); - exit(num); + fprintf(stderr, "Request to RS failed: %s (error %d)\n", strerror(errno), errno); + exit(errno); } @@ -1069,7 +1070,7 @@ PUBLIC int main(int argc, char **argv) message m; int result; int request; - int i, s; + int i; char *label, *progname = NULL; struct passwd *pw; @@ -1141,8 +1142,8 @@ PUBLIC int main(int argc, char **argv) m.RS_CMD_ADDR = (char *) &rs_start; /* Build request message and send the request. */ - if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) - failure(-s); + if (_syscall(RS_PROC_NR, request, &m) == -1) + failure(); else if(req_printep) printf("%d\n", m.RS_ENDPOINT); result = m.m_type; @@ -1153,20 +1154,20 @@ PUBLIC int main(int argc, char **argv) case RS_RESTART: m.RS_CMD_ADDR = req_label; m.RS_CMD_LEN = strlen(req_label); - if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) - failure(-s); + if (_syscall(RS_PROC_NR, request, &m) == -1) + failure(); break; case RS_SHUTDOWN: - if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) - failure(-s); + if (_syscall(RS_PROC_NR, request, &m) == -1) + failure(); break; case RS_UPDATE: m.RS_CMD_ADDR = req_label; m.RS_CMD_LEN = strlen(req_label); m.RS_LU_STATE = req_lu_state; m.RS_LU_PREPARE_MAXTIME = req_prepare_maxtime; - if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) - failure(-s); + if (_syscall(RS_PROC_NR, request, &m) == -1) + failure(); break; default: print_usage(argv[ARG_NAME], "request is not yet supported");