From 4bd3ef75a905d6ea43c8bb8bed213930197874c5 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 18 Jul 2009 18:43:04 -0700 Subject: [PATCH 1/4] (SIGAR-164) return ENXIO instead of ESRCH in disk_usage darwin impl --- src/os/darwin/darwin_sigar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index dd7c64fc..9fcbb807 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -2137,7 +2137,7 @@ int sigar_disk_usage_get(sigar_t *sigar, const char *name, SIGAR_DISK_STATS_INIT(disk); if (!iodev) { - return ESRCH; + return ENXIO; } /* "/dev/disk0s1" -> "disk0" */ /* XXX better way? */ From 9e699babc5b143858db392e8337c0a97be8f2aa7 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 18 Jul 2009 18:43:28 -0700 Subject: [PATCH 2/4] (SIGAR-164) return ENXIO instead of ENOENT in disk_usage aix impl --- src/os/aix/aix_sigar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index 8bb19228..bac4491f 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -1247,7 +1247,7 @@ int sigar_disk_usage_get(sigar_t *sigar, const char *name, SIGAR_SSTRCPY(id.name, name); if (perfstat_disk(&id, &disk, sizeof(disk), 1) != 1) { - return ENOENT; + return ENXIO; } usage->reads = disk.rblks; From 90c2b191274ef59f1b6afe92efac46e9701eb1fc Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 18 Jul 2009 18:43:39 -0700 Subject: [PATCH 3/4] (SIGAR-164) return ENXIO instead of ENOENT in disk_usage linux impl --- src/os/linux/linux_sigar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index 0b5f71b1..2eacbc84 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -1159,7 +1159,7 @@ static int get_iostat_sys(sigar_t *sigar, int partition, status; if (!(*iodev = sigar_iodev_get(sigar, dirname))) { - return ENOENT; + return ENXIO; } name = fsdev = (*iodev)->name; @@ -1211,7 +1211,7 @@ static int get_iostat_proc_dstat(sigar_t *sigar, SIGAR_DISK_STATS_INIT(device_usage); if (!(*iodev = sigar_iodev_get(sigar, dirname))) { - return ENOENT; + return ENXIO; } if (stat((*iodev)->name, &sb) < 0) { @@ -1313,7 +1313,7 @@ static int get_iostat_procp(sigar_t *sigar, struct stat sb; if (!(*iodev = sigar_iodev_get(sigar, dirname))) { - return ENOENT; + return ENXIO; } if (stat((*iodev)->name, &sb) < 0) { From ceab542f7b12e47e4e9cacc825f129e2c75bd3b7 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 18 Jul 2009 18:43:54 -0700 Subject: [PATCH 4/4] (SIGAR-164) return ENXIO instead of ENOENT in disk_usage win32 impl --- src/os/win32/win32_sigar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index fdc7d0c0..ea92b681 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -1956,7 +1956,7 @@ SIGAR_DECLARE(int) sigar_disk_usage_get(sigar_t *sigar, } } - return ENOENT; + return ENXIO; } SIGAR_DECLARE(int)