return better errorcodes
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 5 Mar 2004 04:40:59 +0000 (04:40 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 5 Mar 2004 04:40:59 +0000 (04:40 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1091 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib/getprocentry-legacy.c
util-vserver/lib/syscall-compat.hc
util-vserver/lib/syscall_getflags-v13.hc
util-vserver/lib/syscall_getiattr.c
util-vserver/lib/syscall_getvxinfo-oldproc.hc
util-vserver/lib/syscall_getvxinfo.c
util-vserver/lib/syscall_setflags-v13.hc

index 16d8cd8..f88fa95 100644 (file)
@@ -49,7 +49,7 @@ utilvserver_getProcEntry(pid_t pid,
   char *               res = 0;
 
   if (pid<0 || (uint32_t)(pid)>99999) {
-    errno = EINVAL;
+    errno = EBADR;
     return 0;
   }
 
index 1cbd166..b3838ce 100644 (file)
@@ -43,7 +43,7 @@ vc_set_ipv4root_compat(uint32_t  bcast, size_t nb, struct vc_ip_mask_pair const
   size_t                       i;
 
   if (nb>NB_IPV4ROOT) {
-    errno = -EINVAL;
+    errno = -EOVERFLOW;
     return -1;
   }
 
index 5d8be82..e3f99c6 100644 (file)
@@ -28,7 +28,7 @@ vc_get_flags_v13(xid_t xid, struct vc_ctx_flags *flags)
   int                          res;
 
   if (flags==0) {
-    errno = EINVAL;
+    errno = EFAULT;
     return -1;
   }
   
index fa8f8cc..e63ddf0 100644 (file)
@@ -42,7 +42,7 @@ vc_get_iattr(char const *filename, xid_t *xid,  uint32_t *flags, uint32_t *mask)
   if ( (mask==0) ||
        ((*mask&VC_IATTR_XID)  && xid==0) ||
        ((*mask&~VC_IATTR_XID) && flags==0) ) {
-    errno = EINVAL;
+    errno = EFAULT;
     return -1;
   }
   if ( flags ) *flags &= ~*mask;
index 23d5ebb..09d7b22 100644 (file)
@@ -24,6 +24,6 @@ static inline ALWAYSINLINE int
 vc_get_vx_info_oldproc(xid_t UNUSED xid, struct vc_vx_info UNUSED *info)
 {
   // TODO: ???
-  errno = EINVAL;
+  errno = ENOSYS;
   return -1;
 }
index e41da16..78be327 100644 (file)
@@ -40,7 +40,7 @@ int
 vc_get_vx_info(xid_t xid, struct vc_vx_info *info)
 {
   if (info==0) {
-    errno = EINVAL;
+    errno = EFAULT;
     return -1;
   }
   CALL_VC(CALL_VC_V13    (vc_get_vx_info, xid, info),
index 92a3a80..c400c28 100644 (file)
@@ -27,7 +27,7 @@ vc_set_flags_v13(xid_t xid, struct vc_ctx_flags const *flags)
   struct vcmd_ctx_flags_v0     k_flags;
 
   if (flags==0) {
-    errno = EINVAL;
+    errno = EFAULT;
     return -1;
   }