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

Benjamin Thery benjamin.thery at bull.net
Mon Jun 9 07:47:19 PDT 2008


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 at bull.net>
---
 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 at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list