Module Name:    othersrc
Committed By:   pooka
Date:           Tue Mar 24 16:06:52 UTC 2009

Modified Files:
        othersrc/lib/libfsu_mount: fsu_mount.c fsu_mount.h

Log Message:
Don't warn() about invalid usage.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/lib/libfsu_mount/fsu_mount.c
cvs rdiff -u -r1.1 -r1.2 othersrc/lib/libfsu_mount/fsu_mount.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/lib/libfsu_mount/fsu_mount.c
diff -u othersrc/lib/libfsu_mount/fsu_mount.c:1.3 othersrc/lib/libfsu_mount/fsu_mount.c:1.4
--- othersrc/lib/libfsu_mount/fsu_mount.c:1.3	Tue Mar 24 15:14:23 2009
+++ othersrc/lib/libfsu_mount/fsu_mount.c	Tue Mar 24 16:06:52 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fsu_mount.c,v 1.3 2009/03/24 15:14:23 stacktic Exp $ */
+/* $NetBSD: fsu_mount.c,v 1.4 2009/03/24 16:06:52 pooka Exp $ */
 
 /*
  * Copyright (c) 2008 Arnaud Ysmal.  All Rights Reserved.
@@ -216,7 +216,7 @@
 			break;
 		case '?':
 		default:
-			errno = EINVAL;
+			errno = 0;
 			return NULL;
 		}
 	}
@@ -255,7 +255,7 @@
 
 	if (fst == NULL && idx < *argc) {
 		if (strcmp((*argv)[idx], "--") == 0) {
-			errno = EINVAL;
+			errno = 0;
 			return NULL;
 		}
 
@@ -282,7 +282,7 @@
 				} else
 					fsdevice = (*argv)[idx++];
 			} else {
-				errno = EINVAL;
+				errno = 0;
 				return NULL;
 			}
 		}

Index: othersrc/lib/libfsu_mount/fsu_mount.h
diff -u othersrc/lib/libfsu_mount/fsu_mount.h:1.1 othersrc/lib/libfsu_mount/fsu_mount.h:1.2
--- othersrc/lib/libfsu_mount/fsu_mount.h:1.1	Mon Mar 23 20:54:13 2009
+++ othersrc/lib/libfsu_mount/fsu_mount.h	Tue Mar 24 16:06:52 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fsu_mount.h,v 1.1 2009/03/23 20:54:13 stacktic Exp $ */
+/* $NetBSD: fsu_mount.h,v 1.2 2009/03/24 16:06:52 pooka Exp $ */
 
 /*
  * Copyright (c) 2008 Arnaud Ysmal.  All Rights Reserved.
@@ -28,6 +28,8 @@
 #ifndef _FSU_MOUNT_H_
 #define _FSU_MOUNT_H_
 
+#include <errno.h>
+
 struct ukfs;
 
 struct ukfs	*fsu_mount(int *, char **[], char **, char **);
@@ -51,7 +53,8 @@
 	{							\
 		ukfsp = fsu_mount(&argc, &argv, NULL, NULL);	\
 		if (ukfsp == NULL) {				\
-			warn("fsu_mount");			\
+			if (errno)				\
+				warn("fsu_mount");		\
 			usage();				\
 			/* NOTREACHED */			\
 		} else						\

Reply via email to