kadischi/eject_live_cd eject_live_cd.c,1.5,1.6

Jasper O'neal Hartline (autopsy) fedora-extras-commits at redhat.com
Sun Apr 15 11:46:14 UTC 2007


Author: autopsy

Update of /cvs/devel/kadischi/eject_live_cd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4809/kadischi/eject_live_cd

Modified Files:
	eject_live_cd.c 
Log Message:
Clean up compiler warnings.


Index: eject_live_cd.c
===================================================================
RCS file: /cvs/devel/kadischi/eject_live_cd/eject_live_cd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- eject_live_cd.c	29 Jul 2006 14:30:45 -0000	1.5
+++ eject_live_cd.c	15 Apr 2007 11:46:12 -0000	1.6
@@ -40,17 +40,17 @@
 }
 #endif
 
-static void
+/* static void
 logMessage (const char *format,
 	    ...)
-{
+{ 
   va_list args;
   
   va_start (args, format);
   vprintf(format, args);
   va_end (args);
   printf("\n");
-}
+} */
 
 struct devnum {
     char * name;
@@ -427,8 +427,8 @@
 #define LIVECD_FILE ".livecd"
 
 static int setupCdrom(char * location) {
-    int i, rc;
-    char * buf;
+    int i;
+//    char * buf;
     struct device ** devices = NULL;
 
 /*    logMessage("probing for CDs");  */
@@ -466,16 +466,16 @@
 static int EjectCdrom()
 {
 	int status;
-        int cdrom;
+//        int cdrom;
         int fd = open(CDDEVICE, O_RDONLY|O_NONBLOCK);
-        int lock;
+//        int lock;
         int unlock;
 
         if (fd == -1) {
                         exit(1);
         }
-        if (unlock = ioctl(fd, CDROM_LOCKDOOR, 0) == 0) {
-        if (status = ioctl(fd, CDROMEJECT)<0) {
+        if ((unlock = ioctl(fd, CDROM_LOCKDOOR, 0)) == 0) {
+        if ((status = ioctl(fd, CDROMEJECT))<0) {
              perror("ioctl");
              
         }
@@ -487,17 +487,18 @@
 int main(int argc, char **argv)
 {
 
-	int fd; 
+//	int fd; 
         int worked;	
         char *location = "/mnt/source";
         int livecd;
 
 
-         if (livecd = setupCdrom(location)) {
+         if ((livecd = setupCdrom(location))<0) {
              umount(location);
 	     worked = EjectCdrom();
  
          }
+    return 0;
 }
 
 /*




More information about the scm-commits mailing list