From 14ac7cafc81940f5f389515cb5134e6c52f37813 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 22 Nov 2007 00:32:50 +0000 Subject: 0 is also a valid file descriptor git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15749 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/viewer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 5891ca9736..d81cc094e5 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -1086,7 +1086,7 @@ static void viewer_load_settings(void) /* same name as global, but not the same /* read settings file */ settings_fd=rb->open(SETTINGS_FILE, O_RDONLY); - if (settings_fd && (rb->filesize(settings_fd) == sizeof(struct preferences))) + if ((settings_fd >= 0) && (rb->filesize(settings_fd) == sizeof(struct preferences))) { rb->read(settings_fd, &prefs, sizeof(struct preferences)); rb->close(settings_fd); -- cgit v1.2.3