[PATCH 1/2] cryo: Fix option -l

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This tiny patch fixes the handling of option -l.
'l' must be added to the getopt() call and the subsequent switch{] if
we don't want to exit too soon.

This makes the following command works:

$ cr -l -t test.cryo

Signed-off-by: Benjamin Thery <benjamin.thery@xxxxxxxx>
---
 cr.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: cryodev/cr.c
===================================================================
--- cryodev.orig/cr.c
+++ cryodev/cr.c
@@ -1227,10 +1227,11 @@ int main(int argc, char **argv)
 	int fd = 0;
 	int perm = O_RDONLY;
 
-	while ((ch = getopt(argc, argv, "dmp:rRksf:")) != EOF) {
+	while ((ch = getopt(argc, argv, "dlmp:rRksf:")) != EOF) {
 		switch (ch) {
 		case 'd': 	cr_mode |= CR_DEBUG; Debug_mode = 1; break;
 		case 'k': 	cr_mode |= CR_KILL; break;
+		case 'l':	mode = ch; break;
 		case 's':	cr_mode |= CR_STOP; break;
 		case 'm':	cr_mode |= CR_MMAP; break;
 		case 'p':	mode = ch; fd = 1; perm = O_WRONLY; pid = (pid_t)atoi(optarg); break;

-- 
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux