diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-02 08:49:11 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-02 08:49:11 +0100 |
| commit | 705c9b3487928df07d218f8327d1f4951b17a6bd (patch) | |
| tree | 09487d2881dc23b506b29f23183933759f041731 /miscutils/devfsd.c | |
| parent | 4e815cd7b3b9005a73b9d73584a4e9751d15b8a1 (diff) | |
| download | busybox-w32-705c9b3487928df07d218f8327d1f4951b17a6bd.tar.gz busybox-w32-705c9b3487928df07d218f8327d1f4951b17a6bd.tar.bz2 busybox-w32-705c9b3487928df07d218f8327d1f4951b17a6bd.zip | |
devfsd: constify, code shrink
function old new delta
static.copy_inode 613 608 -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5) Total: -5 bytes
text data bss dec hex filename
1087619 827 5088 1093534 10af9e busybox_old
1087654 787 5088 1093529 10af99 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/devfsd.c')
| -rw-r--r-- | miscutils/devfsd.c | 8 |
1 files changed, 4 insertions, 4 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; |
