diff options
| author | Ron Yorston <rmy@pobox.com> | 2026-02-10 13:49:25 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2026-02-10 13:49:25 +0000 |
| commit | 0e3015ddb8538f6329c59ed984a9c59bba3f376e (patch) | |
| tree | bc3098c638152ceb2ef129f708ce0598a800adb0 /miscutils | |
| parent | 610e1f9ff848d6b07540dc86d12708991786a7d1 (diff) | |
| parent | cdcb4ce314531bfea23b844be7df28ab8c0818da (diff) | |
| download | busybox-w32-0e3015ddb8538f6329c59ed984a9c59bba3f376e.tar.gz busybox-w32-0e3015ddb8538f6329c59ed984a9c59bba3f376e.tar.bz2 busybox-w32-0e3015ddb8538f6329c59ed984a9c59bba3f376e.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/devfsd.c | 8 | ||||
| -rw-r--r-- | miscutils/hdparm.c | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 36b491595..642cd3637 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c | |||
| @@ -306,7 +306,7 @@ static struct config_entry_struct *last_config = NULL; | |||
| 306 | static char *mount_point = NULL; | 306 | static char *mount_point = NULL; |
| 307 | static volatile int caught_signal = FALSE; | 307 | static volatile int caught_signal = FALSE; |
| 308 | static volatile int caught_sighup = FALSE; | 308 | static volatile int caught_sighup = FALSE; |
| 309 | static struct initial_symlink_struct { | 309 | static const struct initial_symlink_struct { |
| 310 | const char *dest; | 310 | const char *dest; |
| 311 | const char *name; | 311 | const char *name; |
| 312 | } initial_symlinks[] = { | 312 | } initial_symlinks[] = { |
| @@ -413,7 +413,7 @@ int devfsd_main(int argc, char **argv) | |||
| 413 | int fd, proto_rev, count; | 413 | int fd, proto_rev, count; |
| 414 | unsigned long event_mask = 0; | 414 | unsigned long event_mask = 0; |
| 415 | struct sigaction new_action; | 415 | struct sigaction new_action; |
| 416 | struct initial_symlink_struct *curr; | 416 | const struct initial_symlink_struct *curr; |
| 417 | 417 | ||
| 418 | if (argc < 2) | 418 | if (argc < 2) |
| 419 | bb_show_usage(); | 419 | bb_show_usage(); |
| @@ -1072,8 +1072,8 @@ static int copy_inode(const char *destpath, const struct stat *dest_stat, | |||
| 1072 | if (fd < 0) | 1072 | if (fd < 0) |
| 1073 | break; | 1073 | break; |
| 1074 | un_addr.sun_family = AF_UNIX; | 1074 | un_addr.sun_family = AF_UNIX; |
| 1075 | snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s", destpath); | 1075 | strncpy(un_addr.sun_path, destpath, sizeof(un_addr.sun_path)); |
| 1076 | val = bind(fd, (struct sockaddr *) &un_addr, (int) sizeof un_addr); | 1076 | val = bind(fd, (struct sockaddr *) &un_addr, (int)sizeof(un_addr)); |
| 1077 | close(fd); | 1077 | close(fd); |
| 1078 | if (val != 0 || chmod(destpath, new_mode & ~S_IFMT) != 0) | 1078 | if (val != 0 || chmod(destpath, new_mode & ~S_IFMT) != 0) |
| 1079 | break; | 1079 | break; |
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 83e2f8d53..8b844717f 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c | |||
| @@ -1464,15 +1464,17 @@ static void read_big_block(/*int fd,*/ char *buf) | |||
| 1464 | static unsigned dev_size_mb(/*int fd*/ void) | 1464 | static unsigned dev_size_mb(/*int fd*/ void) |
| 1465 | { | 1465 | { |
| 1466 | union { | 1466 | union { |
| 1467 | unsigned long long blksize64; | 1467 | /* BLKGETSIZE64 takes pointer to uint64_t, not ullong */ |
| 1468 | unsigned blksize32; | 1468 | uint64_t blksize64; |
| 1469 | unsigned long blksize_long; | ||
| 1469 | } u; | 1470 | } u; |
| 1470 | 1471 | ||
| 1471 | if (0 == ioctl(fd, BLKGETSIZE64, &u.blksize64)) { // bytes | 1472 | if (0 == ioctl(fd, BLKGETSIZE64, &u.blksize64)) { // bytes |
| 1472 | u.blksize64 /= (1024 * 1024); | 1473 | u.blksize64 /= (1024 * 1024); |
| 1473 | } else { | 1474 | } else { |
| 1474 | xioctl(fd, BLKGETSIZE, &u.blksize32); // sectors | 1475 | /* returns size in 512 blocks (not ioctl(BLKSSZ) sized blocks!) */ |
| 1475 | u.blksize64 = u.blksize32 / (2 * 1024); | 1476 | xioctl(fd, BLKGETSIZE, &u.blksize_long); |
| 1477 | u.blksize64 = u.blksize_long / (2 * 1024); | ||
| 1476 | } | 1478 | } |
| 1477 | if (u.blksize64 > UINT_MAX) | 1479 | if (u.blksize64 > UINT_MAX) |
| 1478 | return UINT_MAX; | 1480 | return UINT_MAX; |
