Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148304509
D26376.id76816.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26376.id76816.diff
View Options
Index: usr.bin/posixshmcontrol/posixshmcontrol.1
===================================================================
--- usr.bin/posixshmcontrol/posixshmcontrol.1
+++ usr.bin/posixshmcontrol/posixshmcontrol.1
@@ -120,7 +120,7 @@
To show content of the shared memory segment with the path
.Pa /1 ,
use the command
-.Dl "posixshmcontrol dump /q | hexdump -C"
+.Dl "posixshmcontrol dump /1 | hexdump -C"
.It
To create a segment with the path
.Pa /2
Index: usr.bin/posixshmcontrol/posixshmcontrol.c
===================================================================
--- usr.bin/posixshmcontrol/posixshmcontrol.c
+++ usr.bin/posixshmcontrol/posixshmcontrol.c
@@ -152,9 +152,14 @@
return (2);
}
}
-
argc -= optind;
argv += optind;
+
+ if (argc == 0) {
+ usage();
+ return (2);
+ }
+
ret = 0;
for (i = 0; i < argc; i++) {
ret1 = create_one_shm(argv[i], mode, idx);
@@ -184,6 +189,11 @@
{
int i, ret, ret1;
+ if (argc == 1) {
+ usage();
+ return (2);
+ }
+
ret = 0;
for (i = 1; i < argc; i++) {
ret1 = delete_one_shm(argv[i]);
@@ -352,6 +362,11 @@
{
int i, ret, ret1;
+ if (argc == 1) {
+ usage();
+ return (2);
+ }
+
ret = 0;
for (i = 1; i < argc; i++) {
ret1 = read_one_shm(argv[i]);
@@ -438,6 +453,11 @@
argc -= optind;
argv += optind;
+ if (argc == 0) {
+ usage();
+ return (2);
+ }
+
ret = 0;
for (i = 0; i < argc; i++) {
ret1 = stat_one_shm(argv[i], hsize, uname);
@@ -478,16 +498,21 @@
switch (c) {
case 's':
if (expand_number(optarg, &newsize) == -1)
- err(1, "size:");
+ err(1, "size");
break;
case '?':
default:
return (2);
}
}
-
argc -= optind;
argv += optind;
+
+ if (argc == 0) {
+ usage();
+ return (2);
+ }
+
ret = 0;
for (i = 0; i < argc; i++) {
ret1 = truncate_one_shm(argv[i], newsize);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 2:04 AM (13 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29869062
Default Alt Text
D26376.id76816.diff (1 KB)
Attached To
Mode
D26376: Fix posixshmcontrol nits.
Attached
Detach File
Event Timeline
Log In to Comment