[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gphoto-devel
Subject:    [gphoto-devel] Bug#9670: gphoto uses nonportable constructions
From:       Petr Konecny <pekon () ams ! sunysb ! edu>
Date:       2000-04-25 16:55:03
[Download RAW message or body]

Package: gphoto
Version: 0.4.4
Severity: grave

gphoto uses #include <sys/dir.h> and sys_errlist[errno]. This makes it
impossible to compile on Solaris, therefore the grave severity. Portable
way to do it is using #include <dirent.h> and strerror(errno). See man
opendir and strerror. Patch against CVS is included.

                                                Regards, Petr

Index: directory/directory.c
===================================================================
RCS file: /cvs/gnome/gphoto/directory/directory.c,v
retrieving revision 1.8
diff -u -r1.8 directory.c
--- directory/directory.c	1999/07/01 23:11:05	1.8
+++ directory/directory.c	2000/04/25 16:42:05
@@ -3,7 +3,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/dir.h>
+#include <dirent.h>
 #include <unistd.h>
 #include "../src/gphoto.h"
 #include "../src/util.h"
Index: src/gallery.c
===================================================================
RCS file: /cvs/gnome/gphoto/src/gallery.c,v
retrieving revision 1.24
diff -u -r1.24 gallery.c
--- src/gallery.c	2000/03/24 12:28:28	1.24
+++ src/gallery.c	2000/04/25 16:42:05
@@ -178,7 +178,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>  
-#include <sys/dir.h>
+#include <dirent.h>
 
 extern GtkWidget *index_window;
 /* extern GtkWidget *browse_button; */
Index: src/util.c
===================================================================
RCS file: /cvs/gnome/gphoto/src/util.c,v
retrieving revision 1.28
diff -u -r1.28 util.c
--- src/util.c	2000/03/24 12:28:28	1.28
+++ src/util.c	2000/04/25 16:42:05
@@ -9,7 +9,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/dir.h>
 #include <dirent.h>
 #ifdef __FreeBSD__
 #else
@@ -258,7 +257,7 @@
 	{
 		snprintf(errormsg,1024,
 "The image couldn't be saved to %s because of the following error: \
- %s",filename,sys_errlist[errno]);
+ %s",filename,strerror(errno));
 		error_dialog(errormsg);
 	}
 }



___________________________________________________
gphoto-devel maillist  --- gphoto-devel@gphoto.org
http://lists.styx.net/mailman/listinfo/gphoto-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic