aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fdisk_sun.c8
-rw-r--r--util-linux/taskset.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/util-linux/fdisk_sun.c b/util-linux/fdisk_sun.c
index 427b9487b..66e434833 100644
--- a/util-linux/fdisk_sun.c
+++ b/util-linux/fdisk_sun.c
@@ -292,10 +292,10 @@ create_sunlabel(void)
292 } else { 292 } else {
293 g_heads = read_int(1, g_heads, 1024, 0, "Heads"); 293 g_heads = read_int(1, g_heads, 1024, 0, "Heads");
294 g_sectors = read_int(1, g_sectors, 1024, 0, "Sectors/track"); 294 g_sectors = read_int(1, g_sectors, 1024, 0, "Sectors/track");
295 if (g_cylinders) 295 if (g_cylinders)
296 g_cylinders = read_int(1, g_cylinders - 2, 65535, 0, "Cylinders"); 296 g_cylinders = read_int(1, g_cylinders - 2, 65535, 0, "Cylinders");
297 else 297 else
298 g_cylinders = read_int(1, 0, 65535, 0, "Cylinders"); 298 g_cylinders = read_int(1, 0, 65535, 0, "Cylinders");
299 sunlabel->nacyl = SUN_SSWAP16(read_int(0, 2, 65535, 0, "Alternate cylinders")); 299 sunlabel->nacyl = SUN_SSWAP16(read_int(0, 2, 65535, 0, "Alternate cylinders"));
300 sunlabel->pcylcount = SUN_SSWAP16(read_int(0, g_cylinders + SUN_SSWAP16(sunlabel->nacyl), 65535, 0, "Physical cylinders")); 300 sunlabel->pcylcount = SUN_SSWAP16(read_int(0, g_cylinders + SUN_SSWAP16(sunlabel->nacyl), 65535, 0, "Physical cylinders"));
301 sunlabel->rspeed = SUN_SSWAP16(read_int(1, 5400, 100000, 0, "Rotation speed (rpm)")); 301 sunlabel->rspeed = SUN_SSWAP16(read_int(1, 5400, 100000, 0, "Rotation speed (rpm)"));
diff --git a/util-linux/taskset.c b/util-linux/taskset.c
index afe2f04d2..d2ef9b98f 100644
--- a/util-linux/taskset.c
+++ b/util-linux/taskset.c
@@ -218,7 +218,7 @@ static int process_pid_str(const char *pid_str, unsigned opts, char *aff)
218 ul *mask; 218 ul *mask;
219 unsigned mask_size_in_bytes; 219 unsigned mask_size_in_bytes;
220 const char *current_new; 220 const char *current_new;
221 pid_t pid = xatoi_positive(pid_str); 221 pid_t pid = !pid_str ? 0 : xatou_range(pid_str, 1, INT_MAX); /* disallow "0": "taskset -p 0" should fail */
222 222
223 mask_size_in_bytes = SZOF_UL; 223 mask_size_in_bytes = SZOF_UL;
224 current_new = "current"; 224 current_new = "current";
@@ -343,7 +343,7 @@ int taskset_main(int argc UNUSED_PARAM, char **argv)
343 /* <aff> <cmd...> */ 343 /* <aff> <cmd...> */
344 if (!*argv) 344 if (!*argv)
345 bb_show_usage(); 345 bb_show_usage();
346 process_pid_str("0", opts, aff); 346 process_pid_str(NULL, opts, aff);
347 BB_EXECVP_or_die(argv); 347 BB_EXECVP_or_die(argv);
348 } 348 }
349 349