Module Name:    src
Committed By:   pgoyette
Date:           Wed Feb  5 14:10:47 UTC 2020

Modified Files:
        src/sys/modules/examples/ping: ping.c
        src/sys/modules/examples/ping_block: ping.c

Log Message:
Use ENOTTY as error for an unrecognized ioctl() code, rather than
"magic number" 1.

ok kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/examples/ping/ping.c
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/examples/ping_block/ping.c

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

Modified files:

Index: src/sys/modules/examples/ping/ping.c
diff -u src/sys/modules/examples/ping/ping.c:1.2 src/sys/modules/examples/ping/ping.c:1.3
--- src/sys/modules/examples/ping/ping.c:1.2	Thu Jan 30 07:58:33 2020
+++ src/sys/modules/examples/ping/ping.c	Wed Feb  5 14:10:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping.c,v 1.2 2020/01/30 07:58:33 kamil Exp $	*/
+/*	$NetBSD: ping.c,v 1.3 2020/02/05 14:10:46 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ping.c,v 1.2 2020/01/30 07:58:33 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ping.c,v 1.3 2020/02/05 14:10:46 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -101,7 +101,7 @@ ping_ioctl(dev_t self __unused, u_long c
 		printf("ping: pong!\n");
 		return 0;
 	default:
-		return 1;
+		return ENOTTY;
 	}
 }
 

Index: src/sys/modules/examples/ping_block/ping.c
diff -u src/sys/modules/examples/ping_block/ping.c:1.1 src/sys/modules/examples/ping_block/ping.c:1.2
--- src/sys/modules/examples/ping_block/ping.c:1.1	Wed Feb  5 13:23:42 2020
+++ src/sys/modules/examples/ping_block/ping.c	Wed Feb  5 14:10:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping.c,v 1.1 2020/02/05 13:23:42 kamil Exp $	*/
+/*	$NetBSD: ping.c,v 1.2 2020/02/05 14:10:47 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ping.c,v 1.1 2020/02/05 13:23:42 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ping.c,v 1.2 2020/02/05 14:10:47 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -111,7 +111,7 @@ ping_ioctl(dev_t self __unused, u_long c
 		printf("ping: pong!\n");
 		return 0;
 	default:
-		return 1;
+		return ENOTTY;
 	}
 }
 

Reply via email to