[BusyBox-cvs] busybox/util-linux losetup.c,1.2,1.3

Erik Andersen andersen at busybox.net
Wed Jul 30 08:56:03 UTC 2003


Update of /var/cvs/busybox/util-linux
In directory winder:/tmp/cvs-serv21980/util-linux

Modified Files:
	losetup.c 
Log Message:
Lars Ekman writes:

When using "losetup" the device is always setup as Read-Only.

(I have only tested with the -o flag, but looking at the code the
 problem seems general)

The problem is the "opt" variable in "losetup.c" that is reused in
the "set_loop()" call. Clear it before the call and everything is OK;

  opt = 0;         /* <-------- added line */
  if (delete)
    return del_loop (argv[optind]) ? EXIT_SUCCESS : EXIT_FAILURE;
  else
    return set_loop (argv[optind], argv[optind + 1], offset, &opt)
      ? EXIT_FAILURE : EXIT_SUCCESS;                              
}
 
Best Regards,
Lars Ekman



Index: losetup.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/losetup.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- losetup.c	19 Mar 2003 09:13:01 -0000	1.2
+++ losetup.c	30 Jul 2003 08:55:59 -0000	1.3
@@ -50,6 +50,7 @@
       || (!delete && optind + 2 != argc))
     bb_show_usage();
 
+  opt = 0;
   if (delete)
     return del_loop (argv[optind]) ? EXIT_SUCCESS : EXIT_FAILURE;
   else




More information about the busybox-cvs mailing list