Module Name: src
Committed By: mlelstv
Date: Mon Nov 17 07:15:28 UTC 2014
Modified Files:
src/sbin/gpt: gpt.c gpt.h
Log Message:
handle constness better
To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sbin/gpt/gpt.c
cvs rdiff -u -r1.16 -r1.17 src/sbin/gpt/gpt.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.38 src/sbin/gpt/gpt.c:1.39
--- src/sbin/gpt/gpt.c:1.38 Mon Nov 17 07:13:42 2014
+++ src/sbin/gpt/gpt.c Mon Nov 17 07:15:28 2014
@@ -35,7 +35,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
#endif
#ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.38 2014/11/17 07:13:42 mlelstv Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.39 2014/11/17 07:15:28 mlelstv Exp $");
#endif
#include <sys/param.h>
@@ -65,7 +65,7 @@ __RCSID("$NetBSD: gpt.c,v 1.38 2014/11/1
char device_path[MAXPATHLEN];
const char *device_arg;
-char *device_name;
+const char *device_name;
off_t mediasz;
@@ -563,8 +563,7 @@ gpt_open(const char *dev)
mode = readonly ? O_RDONLY : O_RDWR|O_EXCL;
- device_arg = dev;
- device_name = __UNCONST(device_arg);
+ device_arg = device_name = dev;
fd = opendisk(dev, mode, device_path, sizeof(device_path), 0);
if (fd == -1)
return -1;
Index: src/sbin/gpt/gpt.h
diff -u src/sbin/gpt/gpt.h:1.16 src/sbin/gpt/gpt.h:1.17
--- src/sbin/gpt/gpt.h:1.16 Tue Sep 30 17:59:59 2014
+++ src/sbin/gpt/gpt.h Mon Nov 17 07:15:28 2014
@@ -61,7 +61,7 @@ struct mbr {
};
extern const char *device_arg;
-extern char *device_name;
+extern const char *device_name;
extern off_t mediasz;
extern u_int parts;
extern u_int secsz;