summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGene Z. Ragan <gzr@eazel.com>2001-02-03 08:25:28 +0000
committerGene Ragan <gzr@src.gnome.org>2001-02-03 08:25:28 +0000
commit97d59d2e3ba949bdc38e7ec028f34e7bdf4cdb2f (patch)
treeef385c710e3346d287706a2586b3449d61b2e539
parent97caed032eca3dbc8eb5ce0133715de986f54722 (diff)
downloadnautilus-97d59d2e3ba949bdc38e7ec028f34e7bdf4cdb2f.tar.gz
Do a simple check for NULL instead of using g_return_if_fail. We don't
2001-02-03 Gene Z. Ragan <gzr@eazel.com> Do a simple check for NULL instead of using g_return_if_fail. We don't need the error reported to the terminal. * libnautilus-extensions/nautilus-volume-monitor.c: (get_removable_volumes), (volume_is_removable), (volume_is_read_only):
-rw-r--r--ChangeLog10
-rw-r--r--libnautilus-extensions/nautilus-volume-monitor.c14
-rw-r--r--libnautilus-private/nautilus-volume-monitor.c14
3 files changed, 30 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index ab9479715..a3d06b4ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-02-03 Gene Z. Ragan <gzr@eazel.com>
+
+ Do a simple check for NULL instead of using
+ g_return_if_fail. We don't need the error
+ reported to the terminal.
+
+ * libnautilus-extensions/nautilus-volume-monitor.c:
+ (get_removable_volumes), (volume_is_removable),
+ (volume_is_read_only):
+
2001-02-02 Eskil Heyn Olsen <eskil@eazel.com>
* components/services/install/command-line/eazel-alt-install-corba.
diff --git a/libnautilus-extensions/nautilus-volume-monitor.c b/libnautilus-extensions/nautilus-volume-monitor.c
index 31dd54d5e..2b82447e4 100644
--- a/libnautilus-extensions/nautilus-volume-monitor.c
+++ b/libnautilus-extensions/nautilus-volume-monitor.c
@@ -276,7 +276,9 @@ get_removable_volumes (void)
volumes = NULL;
file = setmntent (_PATH_MNTTAB, "r");
- g_return_val_if_fail (file != NULL, NULL);
+ if (file == NULL) {
+ return NULL;
+ }
while ((ent = getmntent (file)) != NULL) {
/* Use noauto as our way of determining a removable volume */
@@ -316,7 +318,9 @@ volume_is_removable (const NautilusVolume *volume)
struct mntent *ent;
file = setmntent (_PATH_MNTTAB, "r");
- g_return_val_if_fail (file != NULL, FALSE);
+ if (file == NULL) {
+ return FALSE;
+ }
/* Search for our device in the fstab */
while ((ent = getmntent (file)) != NULL) {
@@ -340,8 +344,10 @@ volume_is_read_only (const NautilusVolume *volume)
struct mntent *ent;
file = setmntent (_PATH_MNTTAB, "r");
- g_return_val_if_fail (file != NULL, FALSE);
-
+ if (file == NULL) {
+ return FALSE;
+ }
+
/* Search for our device in the fstab */
while ((ent = getmntent (file)) != NULL) {
if (strcmp (volume->device_path, ent->mnt_fsname) == 0) {
diff --git a/libnautilus-private/nautilus-volume-monitor.c b/libnautilus-private/nautilus-volume-monitor.c
index 31dd54d5e..2b82447e4 100644
--- a/libnautilus-private/nautilus-volume-monitor.c
+++ b/libnautilus-private/nautilus-volume-monitor.c
@@ -276,7 +276,9 @@ get_removable_volumes (void)
volumes = NULL;
file = setmntent (_PATH_MNTTAB, "r");
- g_return_val_if_fail (file != NULL, NULL);
+ if (file == NULL) {
+ return NULL;
+ }
while ((ent = getmntent (file)) != NULL) {
/* Use noauto as our way of determining a removable volume */
@@ -316,7 +318,9 @@ volume_is_removable (const NautilusVolume *volume)
struct mntent *ent;
file = setmntent (_PATH_MNTTAB, "r");
- g_return_val_if_fail (file != NULL, FALSE);
+ if (file == NULL) {
+ return FALSE;
+ }
/* Search for our device in the fstab */
while ((ent = getmntent (file)) != NULL) {
@@ -340,8 +344,10 @@ volume_is_read_only (const NautilusVolume *volume)
struct mntent *ent;
file = setmntent (_PATH_MNTTAB, "r");
- g_return_val_if_fail (file != NULL, FALSE);
-
+ if (file == NULL) {
+ return FALSE;
+ }
+
/* Search for our device in the fstab */
while ((ent = getmntent (file)) != NULL) {
if (strcmp (volume->device_path, ent->mnt_fsname) == 0) {