From d1516c4d628dbded9e1abefaacc1535aaecef418 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 17 Jul 2010 22:43:42 +0200 Subject: dos2unix: fix the case w/o parameters Signed-off-by: Denys Vlasenko --- coreutils/dos2unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coreutils') diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index 1911f5319..e06ecc4e0 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c @@ -92,7 +92,7 @@ int dos2unix_main(int argc UNUSED_PARAM, char **argv) do { /* might be convert(NULL) if there is no filename given */ convert(*argv, conv_type); - } while (*++argv); + } while (*argv && *++argv); return 0; } -- cgit v1.2.3-55-g6feb From b175462422f02a159a14dc5561d8bef6f84b2b66 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Thu, 27 May 2010 15:32:19 +0200 Subject: readlink: use xmalloc_realpath() Using realpath() directly with a non-NULL output buffer is unsafe because its behavior is unspecified on systems which don't have PATH_MAX (ie. Hurd) I beleive this also fixes a small bug whereby 'buf' would not be freed on 'readlink -v' with ENABLE_FEATURE_CLEANUP. Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- coreutils/readlink.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'coreutils') diff --git a/coreutils/readlink.c b/coreutils/readlink.c index 20df38b96..2ed5e2cac 100644 --- a/coreutils/readlink.c +++ b/coreutils/readlink.c @@ -36,7 +36,6 @@ int readlink_main(int argc UNUSED_PARAM, char **argv) { char *buf; char *fname; - char pathbuf[PATH_MAX]; IF_FEATURE_READLINK_FOLLOW( unsigned opt; @@ -56,7 +55,7 @@ int readlink_main(int argc UNUSED_PARAM, char **argv) logmode = LOGMODE_NONE; if (opt & 1) { /* -f */ - buf = realpath(fname, pathbuf); + buf = xmalloc_realpath(fname); } else { buf = xmalloc_readlink_or_warn(fname); } @@ -65,7 +64,7 @@ int readlink_main(int argc UNUSED_PARAM, char **argv) return EXIT_FAILURE; printf((opt & 2) ? "%s" : "%s\n", buf); - if (ENABLE_FEATURE_CLEAN_UP && !opt) + if (ENABLE_FEATURE_CLEAN_UP) free(buf); fflush_stdout_and_exit(EXIT_SUCCESS); -- cgit v1.2.3-55-g6feb From 1d7266d3b59be361763dab61f680103bbb70f3e9 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Mon, 19 Jul 2010 00:44:56 +0200 Subject: mark Linux-specific configuration options PLATFORM_LINUX is used as a dependency for applets or features which require Linux-specific interfaces. Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- Config.in | 12 ++++++++++++ console-tools/Config.src | 13 +++++++++++++ coreutils/Config.src | 2 ++ coreutils/date.c | 2 +- e2fsprogs/Config.src | 1 + init/Config.src | 2 ++ init/bootchartd.c | 1 + libbb/Config.src | 1 + loginutils/Config.src | 3 +++ miscutils/Config.src | 19 ++++++++++++++++++- miscutils/conspy.c | 1 + miscutils/ubi_attach_detach.c | 2 ++ modutils/Config.src | 1 + networking/Config.src | 23 ++++++++++++++++++++++- networking/udhcp/Config.src | 2 ++ procps/Config.src | 4 +++- shell/cttyhack.c | 1 + sysklogd/Config.src | 1 + util-linux/Config.src | 27 +++++++++++++++++++++++++++ 19 files changed, 114 insertions(+), 4 deletions(-) (limited to 'coreutils') diff --git a/Config.in b/Config.in index eebc9774d..35f43b3cd 100644 --- a/Config.in +++ b/Config.in @@ -47,6 +47,17 @@ config USE_PORTABLE_CODE compiler other than gcc. If you do use gcc, this option may needlessly increase code size. +config PLATFORM_LINUX + bool "Enable Linux-specific applets and features" + default y + help + For the most part, busybox requires only POSIX compatibility + from the target system, but some applets and features use + Linux-specific interfaces. + + Answering 'N' here will disable such applets and hide the + corresponding configuration options. + choice prompt "Buffer allocation policy" default FEATURE_BUFFERS_USE_MALLOC @@ -353,6 +364,7 @@ config FEATURE_SUID_CONFIG_QUIET config SELINUX bool "Support NSA Security Enhanced Linux" default n + depends on PLATFORM_LINUX help Enable support for SELinux in applets ls, ps, and id. Also provide the option of compiling in SELinux applets. diff --git a/console-tools/Config.src b/console-tools/Config.src index 6e3191ada..cdb26800e 100644 --- a/console-tools/Config.src +++ b/console-tools/Config.src @@ -10,6 +10,7 @@ INSERT config CHVT bool "chvt" default y + depends on PLATFORM_LINUX help This program is used to change to another terminal. Example: chvt 4 (change to terminal /dev/tty4) @@ -17,6 +18,7 @@ config CHVT config FGCONSOLE bool "fgconsole" default y + depends on PLATFORM_LINUX help This program prints active (foreground) console number. @@ -29,12 +31,14 @@ config CLEAR config DEALLOCVT bool "deallocvt" default y + depends on PLATFORM_LINUX help This program deallocates unused virtual consoles. config DUMPKMAP bool "dumpkmap" default y + depends on PLATFORM_LINUX help This program dumps the kernel's keyboard translation table to stdout, in binary format. You can then use loadkmap to load it. @@ -42,18 +46,21 @@ config DUMPKMAP config KBD_MODE bool "kbd_mode" default y + depends on PLATFORM_LINUX help This program reports and sets keyboard mode. config LOADFONT bool "loadfont" default y + depends on PLATFORM_LINUX help This program loads a console font from standard input. config LOADKMAP bool "loadkmap" default y + depends on PLATFORM_LINUX help This program loads a keyboard translation table from standard input. @@ -61,6 +68,7 @@ config LOADKMAP config OPENVT bool "openvt" default y + depends on PLATFORM_LINUX help This program is used to start a command on an unused virtual terminal. @@ -92,6 +100,7 @@ config FEATURE_RESIZE_PRINT config SETCONSOLE bool "setconsole" default y + depends on PLATFORM_LINUX help This program redirects the system console to another device, like the current tty while logged in via telnet. @@ -106,6 +115,7 @@ config FEATURE_SETCONSOLE_LONG_OPTIONS config SETFONT bool "setfont" default y + depends on PLATFORM_LINUX help Allows to load console screen map. Useful for i18n. @@ -127,6 +137,7 @@ config DEFAULT_SETFONT_DIR config SETKEYCODES bool "setkeycodes" default y + depends on PLATFORM_LINUX help This program loads entries into the kernel's scancode-to-keycode map, allowing unusual keyboards to generate usable keycodes. @@ -134,12 +145,14 @@ config SETKEYCODES config SETLOGCONS bool "setlogcons" default y + depends on PLATFORM_LINUX help This program redirects the output console of kernel messages. config SHOWKEY bool "showkey" default y + depends on PLATFORM_LINUX help Shows keys pressed. diff --git a/coreutils/Config.src b/coreutils/Config.src index d4c9e0541..780b73fda 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src @@ -591,6 +591,7 @@ config FEATURE_SPLIT_FANCY config STAT bool "stat" default y + depends on PLATFORM_LINUX # statfs() help display file or filesystem status. @@ -606,6 +607,7 @@ config FEATURE_STAT_FORMAT config STTY bool "stty" default y + depends on PLATFORM_LINUX help stty is used to change and print terminal line settings. diff --git a/coreutils/date.c b/coreutils/date.c index c737f09f3..cb41724af 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -72,7 +72,7 @@ //config:config FEATURE_DATE_NANO //config: bool "Support %[num]N nanosecond format specifier" //config: default n -//config: depends on DATE +//config: depends on DATE && PLATFORM_LINUX # syscall(__NR_clock_gettime) //config: help //config: Support %[num]N format specifier. Adds ~250 bytes of code. //config: diff --git a/e2fsprogs/Config.src b/e2fsprogs/Config.src index 62bc810f8..6043e9b57 100644 --- a/e2fsprogs/Config.src +++ b/e2fsprogs/Config.src @@ -33,6 +33,7 @@ config FSCK config LSATTR bool "lsattr" default y + depends on PLATFORM_LINUX help lsattr lists the file attributes on a second extended file system. diff --git a/init/Config.src b/init/Config.src index 590e29890..a5e76be6a 100644 --- a/init/Config.src +++ b/init/Config.src @@ -10,6 +10,7 @@ INSERT config INIT bool "init" default y + depends on PLATFORM_LINUX select FEATURE_SYSLOG help init is the first program run when the system boots. @@ -92,6 +93,7 @@ config FEATURE_INITRD config HALT bool "poweroff, halt, and reboot" default y + depends on PLATFORM_LINUX help Stop all processes and either halt, reboot, or power off the system. diff --git a/init/bootchartd.c b/init/bootchartd.c index dae2fe6e9..a1c01641b 100644 --- a/init/bootchartd.c +++ b/init/bootchartd.c @@ -6,6 +6,7 @@ //config:config BOOTCHARTD //config: bool "bootchartd" //config: default y +//config: depends on PLATFORM_LINUX //config: help //config: bootchartd is commonly used to profile the boot process //config: for the purpose of speeding it up. In this case, it is started diff --git a/libbb/Config.src b/libbb/Config.src index 09bf89246..9b01757c6 100644 --- a/libbb/Config.src +++ b/libbb/Config.src @@ -153,6 +153,7 @@ config FEATURE_COPYBUF_KB config MONOTONIC_SYSCALL bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" default n + depends on PLATFORM_LINUX help Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring time intervals (time, ping, traceroute etc need this). diff --git a/loginutils/Config.src b/loginutils/Config.src index 5d497c4dc..425d041b9 100644 --- a/loginutils/Config.src +++ b/loginutils/Config.src @@ -179,6 +179,7 @@ config DELUSER config GETTY bool "getty" default y + depends on PLATFORM_LINUX select FEATURE_SYSLOG help getty lets you log in on a tty, it is normally invoked by init. @@ -186,6 +187,7 @@ config GETTY config LOGIN bool "login" default y + depends on PLATFORM_LINUX select FEATURE_SUID select FEATURE_SYSLOG help @@ -295,6 +297,7 @@ config SULOGIN config VLOCK bool "vlock" default y + depends on PLATFORM_LINUX select FEATURE_SUID help Build the "vlock" applet which allows you to lock (virtual) terminals. diff --git a/miscutils/Config.src b/miscutils/Config.src index 2f7c50271..e89e231e6 100644 --- a/miscutils/Config.src +++ b/miscutils/Config.src @@ -10,6 +10,7 @@ INSERT config ADJTIMEX bool "adjtimex" default y + depends on PLATFORM_LINUX help Adjtimex reads and optionally sets adjustment parameters for the Linux clock adjustment algorithm. @@ -24,6 +25,7 @@ config BBCONFIG config BEEP bool "beep" default y + depends on PLATFORM_LINUX help The beep applets beeps in a given freq/Hz. @@ -180,6 +182,7 @@ config FEATURE_DC_LIBM config DEVFSD bool "devfsd (obsolete)" default n + depends on PLATFORM_LINUX select FEATURE_SYSLOG help This is deprecated and should NOT be used anymore. @@ -223,6 +226,7 @@ config DEVFSD_VERBOSE config FEATURE_DEVFS bool "Use devfs names for all devices (obsolete)" default n + depends on PLATFORM_LINUX help This is obsolete and should NOT be used anymore. Use linux >= 2.6 (optionally with hotplug) and mdev instead! @@ -242,6 +246,7 @@ config DEVMEM config EJECT bool "eject" default y + depends on PLATFORM_LINUX help Used to eject cdroms. (defaults to /dev/cdrom) @@ -256,6 +261,7 @@ config FEATURE_EJECT_SCSI config FBSPLASH bool "fbsplash" default y + depends on PLATFORM_LINUX help Shows splash image and progress bar on framebuffer device. Can be used during boot phase of an embedded device. ~2kb. @@ -305,6 +311,7 @@ config FLASH_ERASEALL config IONICE bool "ionice" default y + depends on PLATFORM_LINUX help Set/set program io scheduling class and priority Requires kernel >= 2.6.13 @@ -344,6 +351,11 @@ endchoice config LESS bool "less" default y + depends on PLATFORM_LINUX + depends on PLATFORM_LINUX + depends on PLATFORM_LINUX + depends on PLATFORM_LINUX + depends on PLATFORM_LINUX help 'less' is a pager, meaning that it displays text files. It possesses a wide array of features, and is an improvement over 'more'. @@ -410,6 +422,7 @@ config FEATURE_LESS_LINENUMS config HDPARM bool "hdparm" default y + depends on PLATFORM_LINUX help Get/Set hard drive parameters. Primarily intended for ATA drives. Adds about 13k (or around 30k if you enable the @@ -526,6 +539,7 @@ config MT config RAIDAUTORUN bool "raidautorun" default y + depends on PLATFORM_LINUX help raidautorun tells the kernel md driver to search and start RAID arrays. @@ -533,7 +547,7 @@ config RAIDAUTORUN config READAHEAD bool "readahead" default y - depends on LFS + depends on LFS && PLATFORM_LINUX help Preload the files listed on the command line into RAM cache so that subsequent reads on these files will not block on disk I/O. @@ -550,6 +564,7 @@ config READAHEAD config RFKILL bool "rfkill" default n # doesn't build on Ubuntu 9.04 + depends on PLATFORM_LINUX help Enable/disable wireless devices. @@ -570,6 +585,7 @@ config RUNLEVEL config RX bool "rx" default y + depends on PLATFORM_LINUX help Receive files using the Xmodem protocol. @@ -641,6 +657,7 @@ config WALL config WATCHDOG bool "watchdog" default y + depends on PLATFORM_LINUX help The watchdog utility is used with hardware or software watchdog device drivers. It opens the specified watchdog device special file diff --git a/miscutils/conspy.c b/miscutils/conspy.c index 509a0f271..a173d8efd 100644 --- a/miscutils/conspy.c +++ b/miscutils/conspy.c @@ -17,6 +17,7 @@ //config:config CONSPY //config: bool "conspy" //config: default n +//config: depends on PLATFORM_LINUX //config: help //config: A text-mode VNC like program for Linux virtual terminals. //config: example: conspy NUM shared access to console num diff --git a/miscutils/ubi_attach_detach.c b/miscutils/ubi_attach_detach.c index 7b92a8afc..0d63a10d5 100644 --- a/miscutils/ubi_attach_detach.c +++ b/miscutils/ubi_attach_detach.c @@ -12,12 +12,14 @@ //config:config UBIATTACH //config: bool "ubiattach" //config: default n +//config: depends on PLATFORM_LINUX //config: help //config: Attach MTD device to an UBI device. //config: //config:config UBIDETACH //config: bool "ubidetach" //config: default n +//config: depends on PLATFORM_LINUX //config: help //config: Detach MTD device from an UBI device. diff --git a/modutils/Config.src b/modutils/Config.src index a7dcb3ab3..4191d29f2 100644 --- a/modutils/Config.src +++ b/modutils/Config.src @@ -4,6 +4,7 @@ # menu "Linux Module Utilities" +depends on PLATFORM_LINUX INSERT diff --git a/networking/Config.src b/networking/Config.src index 449436247..26c59e7c1 100644 --- a/networking/Config.src +++ b/networking/Config.src @@ -43,6 +43,7 @@ config FEATURE_PREFER_IPV4_ADDRESS config VERBOSE_RESOLUTION_ERRORS bool "Verbose resolution errors" default n + depends on PLATFORM_LINUX #because of xsocket() in libbb/xfuncs_prinf.c help Enable if you are not satisfied with simplistic "can't resolve 'hostname.com'" and want to know more. @@ -51,18 +52,21 @@ config VERBOSE_RESOLUTION_ERRORS config ARP bool "arp" default y + depends on PLATFORM_LINUX help Manipulate the system ARP cache. config ARPING bool "arping" default y + depends on PLATFORM_LINUX help Ping hosts by ARP packets. config BRCTL bool "brctl" default y + depends on PLATFORM_LINUX help Manage ethernet bridges. Supports addbr/delbr and addif/delif. @@ -95,6 +99,7 @@ config DNSD config ETHER_WAKE bool "ether-wake" default y + depends on PLATFORM_LINUX help Send a magic packet to wake up sleeping machines. @@ -269,6 +274,7 @@ config FEATURE_HTTPD_PROXY config IFCONFIG bool "ifconfig" default y + depends on PLATFORM_LINUX help Ifconfig is used to configure the kernel-resident network interfaces. @@ -316,6 +322,7 @@ config FEATURE_IFCONFIG_BROADCAST_PLUS config IFENSLAVE bool "ifenslave" default y + depends on PLATFORM_LINUX help Userspace application to bind several interfaces to a logical interface (use with kernel bonding driver). @@ -323,6 +330,7 @@ config IFENSLAVE config IFPLUGD bool "ifplugd" default y + depends on PLATFORM_LINUX help Network interface plug detection daemon. @@ -364,7 +372,7 @@ config FEATURE_IFUPDOWN_IP config FEATURE_IFUPDOWN_IP_BUILTIN bool "Use busybox ip applet" default y - depends on FEATURE_IFUPDOWN_IP + depends on FEATURE_IFUPDOWN_IP && PLATFORM_LINUX select IP select FEATURE_IP_ADDRESS select FEATURE_IP_LINK @@ -483,6 +491,7 @@ config FEATURE_INETD_RPC config IP bool "ip" default y + depends on PLATFORM_LINUX help The "ip" applet is a TCP/IP interface configuration and routing utility. You generally don't need "ip" to use busybox with @@ -598,6 +607,7 @@ config FEATURE_IPCALC_LONG_OPTIONS config NAMEIF bool "nameif" default y + depends on PLATFORM_LINUX select FEATURE_SYSLOG help nameif is used to rename network interface by its MAC address. @@ -626,6 +636,7 @@ config FEATURE_NAMEIF_EXTENDED config NETSTAT bool "netstat" default y + depends on PLATFORM_LINUX help netstat prints information about the Linux networking subsystem. @@ -654,6 +665,7 @@ config NSLOOKUP config NTPD bool "ntpd" default y + depends on PLATFORM_LINUX help The NTP client/server daemon. @@ -668,6 +680,7 @@ config FEATURE_NTPD_SERVER config PING bool "ping" default y + depends on PLATFORM_LINUX help ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. @@ -696,12 +709,14 @@ config PSCAN config ROUTE bool "route" default y + depends on PLATFORM_LINUX help Route displays or manipulates the kernel's IP routing tables. config SLATTACH bool "slattach" default y + depends on PLATFORM_LINUX help slattach is a small utility to attach network interfaces to serial lines. @@ -719,6 +734,7 @@ config SLATTACH config TCPSVD bool "tcpsvd" default y + depends on PLATFORM_LINUX help tcpsvd listens on a TCP port and runs a program for each new connection. @@ -888,6 +904,7 @@ config TFTP_DEBUG config TRACEROUTE bool "traceroute" default y + depends on PLATFORM_LINUX help Utility to trace the route of IP packets. @@ -924,6 +941,7 @@ config FEATURE_TRACEROUTE_USE_ICMP config TUNCTL bool "tunctl" default y + depends on PLATFORM_LINUX help tunctl creates or deletes tun devices. @@ -949,6 +967,7 @@ config IFUPDOWN_UDHCPC_CMD_OPTIONS config UDPSVD bool "udpsvd" default y + depends on PLATFORM_LINUX help udpsvd listens on an UDP port and runs a program for each new connection. @@ -956,6 +975,7 @@ config UDPSVD config VCONFIG bool "vconfig" default y + depends on PLATFORM_LINUX help Creates, removes, and configures VLAN interfaces @@ -990,6 +1010,7 @@ config FEATURE_WGET_LONG_OPTIONS config ZCIP bool "zcip" default y + depends on PLATFORM_LINUX select FEATURE_SYSLOG help ZCIP provides ZeroConf IPv4 address selection, according to RFC 3927. diff --git a/networking/udhcp/Config.src b/networking/udhcp/Config.src index aac88569b..331dffc2e 100644 --- a/networking/udhcp/Config.src +++ b/networking/udhcp/Config.src @@ -8,6 +8,7 @@ INSERT config UDHCPD bool "udhcp server (udhcpd)" default y + depends on PLATFORM_LINUX help udhcpd is a DHCP server geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. @@ -51,6 +52,7 @@ config DHCPD_LEASES_FILE config UDHCPC bool "udhcp client (udhcpc)" default y + depends on PLATFORM_LINUX help udhcpc is a DHCP client geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. diff --git a/procps/Config.src b/procps/Config.src index e61de5614..1ff6dfd30 100644 --- a/procps/Config.src +++ b/procps/Config.src @@ -10,6 +10,7 @@ INSERT config FREE bool "free" default y + depends on PLATFORM_LINUX #sysinfo() help free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. @@ -104,7 +105,7 @@ config FEATURE_PS_WIDE config FEATURE_PS_TIME bool "Enable time and elapsed time output" default y - depends on PS && DESKTOP + depends on PS && DESKTOP && PLATFORM_LINUX #sysinfo() help Support -o time and -o etime output specifiers. @@ -200,6 +201,7 @@ config FEATURE_SHOW_THREADS config UPTIME bool "uptime" default y + depends on PLATFORM_LINUX #sysinfo() help uptime gives a one line display of the current time, how long the system has been running, how many users are currently logged diff --git a/shell/cttyhack.c b/shell/cttyhack.c index 7af13fdfd..a80d49dc3 100644 --- a/shell/cttyhack.c +++ b/shell/cttyhack.c @@ -13,6 +13,7 @@ //config:config CTTYHACK //config: bool "cttyhack" //config: default y +//config: depends on PLATFORM_LINUX //config: help //config: One common problem reported on the mailing list is "can't access tty; //config: job control turned off" error message which typically appears when diff --git a/sysklogd/Config.src b/sysklogd/Config.src index 6d574abb1..bfe2d1cc3 100644 --- a/sysklogd/Config.src +++ b/sysklogd/Config.src @@ -109,6 +109,7 @@ config FEATURE_LOGREAD_REDUCED_LOCKING config KLOGD bool "klogd" default y + depends on PLATFORM_LINUX help klogd is a utility which intercepts and logs all messages from the Linux kernel and sends the messages diff --git a/util-linux/Config.src b/util-linux/Config.src index 91d1fc2ce..98953c17b 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -10,6 +10,7 @@ INSERT config ACPID bool "acpid" default y + depends on PLATFORM_LINUX help acpid listens to ACPI events coming either in textual form from /proc/acpi/event (though it is marked deprecated it is still widely @@ -32,6 +33,7 @@ config FEATURE_ACPID_COMPAT config BLKID bool "blkid" default y + depends on PLATFORM_LINUX select VOLUMEID help Lists labels and UUIDs of all filesystems. @@ -41,6 +43,7 @@ config BLKID config DMESG bool "dmesg" default y + depends on PLATFORM_LINUX help dmesg is used to examine or control the kernel ring buffer. When the Linux kernel prints messages to the system log, they are stored in @@ -74,6 +77,7 @@ config FEATURE_DMESG_PRETTY config FBSET bool "fbset" default y + depends on PLATFORM_LINUX help fbset is used to show or change the settings of a Linux frame buffer device. The frame buffer device provides a simple and unique @@ -102,6 +106,7 @@ config FEATURE_FBSET_READMODE config FDFLUSH bool "fdflush" default y + depends on PLATFORM_LINUX help fdflush is only needed when changing media on slightly-broken removable media drives. It is used to make Linux believe that a @@ -114,12 +119,14 @@ config FDFLUSH config FDFORMAT bool "fdformat" default y + depends on PLATFORM_LINUX help fdformat is used to low-level format a floppy disk. config FDISK bool "fdisk" default y + depends on PLATFORM_LINUX help The fdisk utility is used to divide hard disks into one or more logical disks, which are generally called partitions. This utility @@ -187,6 +194,7 @@ config FEATURE_FDISK_ADVANCED config FINDFS bool "findfs" default y + depends on PLATFORM_LINUX select VOLUMEID help Prints the name of a filesystem with given label or UUID. @@ -202,6 +210,7 @@ config FLOCK config FREERAMDISK bool "freeramdisk" default y + depends on PLATFORM_LINUX help Linux allows you to create ramdisks. This utility allows you to delete them and completely free all memory that was used for the @@ -224,12 +233,14 @@ config FSCK_MINIX config MKFS_EXT2 bool "mkfs_ext2" default y + depends on PLATFORM_LINUX help Utility to create EXT2 filesystems. config MKFS_MINIX bool "mkfs_minix" default y + depends on PLATFORM_LINUX help The minix filesystem is a nice, small, compact, read-write filesystem with little overhead. If you wish to be able to create minix @@ -247,6 +258,7 @@ config FEATURE_MINIX2 config MKFS_REISER bool "mkfs_reiser" default n + depends on PLATFORM_LINUX help Utility to create ReiserFS filesystems. Note: this applet needs a lot of testing and polishing. @@ -254,6 +266,7 @@ config MKFS_REISER config MKFS_VFAT bool "mkfs_vfat" default y + depends on PLATFORM_LINUX help Utility to create FAT32 filesystems. @@ -302,6 +315,7 @@ config HD config HWCLOCK bool "hwclock" default y + depends on PLATFORM_LINUX help The hwclock utility is used to read and set the hardware clock on a system. This is primarily used to set the current time on @@ -341,6 +355,7 @@ config IPCRM config IPCS bool "ipcs" default y + depends on PLATFORM_LINUX select FEATURE_SUID help The ipcs utility is used to provide information on the currently @@ -349,6 +364,7 @@ config IPCS config LOSETUP bool "losetup" default y + depends on PLATFORM_LINUX help losetup is used to associate or detach a loop device with a regular file or block device, and to query the status of a loop device. This @@ -357,6 +373,7 @@ config LOSETUP config LSPCI bool "lspci" default y + #depends on PLATFORM_LINUX help lspci is a utility for displaying information about PCI buses in the system and devices connected to them. @@ -366,6 +383,7 @@ config LSPCI config LSUSB bool "lsusb" default y + #depends on PLATFORM_LINUX help lsusb is a utility for displaying information about USB buses in the system and devices connected to them. @@ -375,6 +393,7 @@ config LSUSB config MDEV bool "mdev" default y + depends on PLATFORM_LINUX help mdev is a mini-udev implementation for dynamically creating device nodes in the /dev directory. @@ -473,6 +492,7 @@ config FEATURE_USE_TERMIOS config MOUNT bool "mount" default y + depends on PLATFORM_LINUX help All files and filesystems in Unix are arranged into one big directory tree. The 'mount' utility is used to graft a filesystem onto a @@ -555,6 +575,7 @@ config FEATURE_MOUNT_FSTAB config PIVOT_ROOT bool "pivot_root" default y + depends on PLATFORM_LINUX help The pivot_root utility swaps the mount points for the root filesystem with some other mounted filesystem. This allows you to do all sorts @@ -582,12 +603,14 @@ config RDEV config READPROFILE bool "readprofile" default y + #depends on PLATFORM_LINUX help This allows you to parse /proc/profile for basic profiling. config RTCWAKE bool "rtcwake" default y + depends on PLATFORM_LINUX help Enter a system sleep state until specified wakeup time. @@ -607,6 +630,7 @@ config SCRIPTREPLAY config SETARCH bool "setarch" default y + depends on PLATFORM_LINUX help The linux32 utility is used to create a 32bit environment for the specified program (usually a shell). It only makes sense to have @@ -616,6 +640,7 @@ config SETARCH config SWAPONOFF bool "swaponoff" default y + depends on PLATFORM_LINUX help This option enables both the 'swapon' and the 'swapoff' utilities. Once you have created some swap space using 'mkswap', you also need @@ -634,6 +659,7 @@ config FEATURE_SWAPON_PRI config SWITCH_ROOT bool "switch_root" default y + depends on PLATFORM_LINUX help The switch_root utility is used from initramfs to select a new root device. Under initramfs, you have to use this instead of @@ -653,6 +679,7 @@ config SWITCH_ROOT config UMOUNT bool "umount" default y + depends on PLATFORM_LINUX help When you want to remove a mounted filesystem from its current mount point, for example when you are shutting down the system, the -- cgit v1.2.3-55-g6feb From f3ea792badae9cd7c4205ac363301f1e94e57d4e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 26 Jul 2010 01:06:14 +0200 Subject: *: mass cosmetic removal of extra empty lines. no code changes Signed-off-by: Denys Vlasenko --- archival/bz/compress.c | 1 - archival/unzip.c | 1 - coreutils/cut.c | 1 - coreutils/expr.c | 1 - coreutils/ls.c | 2 -- e2fsprogs/old_e2fsprogs/e2fsck.c | 34 +++++++++----------------- e2fsprogs/old_e2fsprogs/ext2fs/alloc.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/alloc_tables.c | 4 --- e2fsprogs/old_e2fsprogs/ext2fs/bb_inode.c | 6 ----- e2fsprogs/old_e2fsprogs/ext2fs/bitops.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/block.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/bmap.c | 3 --- e2fsprogs/old_e2fsprogs/ext2fs/bmove.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/brel.h | 1 - e2fsprogs/old_e2fsprogs/ext2fs/closefs.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/cmp_bitmaps.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/dir_iterate.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/dirblock.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/dupfs.c | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/e2image.h | 13 ---------- e2fsprogs/old_e2fsprogs/ext2fs/ext2_ext_attr.h | 1 - e2fsprogs/old_e2fsprogs/ext2fs/ext2fsP.h | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/freefs.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/get_pathname.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/ind_block.c | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/inline.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/inode.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/inode_io.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/jfs_dat.h | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/lookup.c | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/mkdir.c | 3 --- e2fsprogs/old_e2fsprogs/ext2fs/mkjournal.c | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/namei.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/newdir.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/read_bb.c | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/read_bb_file.c | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/res_gdt.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/rs_bitmap.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/rw_bitmaps.c | 1 - e2fsprogs/old_e2fsprogs/ext2fs/swapfs.c | 2 -- e2fsprogs/old_e2fsprogs/ext2fs/unlink.c | 1 - e2fsprogs/old_e2fsprogs/util.c | 1 - loginutils/addgroup.c | 1 - miscutils/crond.c | 1 - miscutils/hdparm.c | 4 +-- networking/ntpd.c | 1 - networking/telnet.c | 1 - networking/traceroute.c | 1 - selinux/setfiles.c | 1 - shell/ash.c | 2 -- shell/hush.c | 1 - util-linux/fdisk.c | 1 - util-linux/volume_id/volume_id.c | 1 - 53 files changed, 13 insertions(+), 111 deletions(-) (limited to 'coreutils') diff --git a/archival/bz/compress.c b/archival/bz/compress.c index 640b8872b..b9b0949a9 100644 --- a/archival/bz/compress.c +++ b/archival/bz/compress.c @@ -212,7 +212,6 @@ void generateMTFValues(EState* s) wr++; s->mtfFreq[j+1]++; } - } } diff --git a/archival/unzip.c b/archival/unzip.c index 84081c021..d9705a56e 100644 --- a/archival/unzip.c +++ b/archival/unzip.c @@ -359,7 +359,6 @@ int unzip_main(int argc, char **argv) default: bb_show_usage(); - } break; diff --git a/coreutils/cut.c b/coreutils/cut.c index 53f343a33..696478bb2 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -37,7 +37,6 @@ static int cmpfunc(const void *a, const void *b) { return (((struct cut_list *) a)->startpos - ((struct cut_list *) b)->startpos); - } static void cut_file(FILE *file, char delim, const struct cut_list *cut_lists, unsigned nlists) diff --git a/coreutils/expr.c b/coreutils/expr.c index f40edad4e..8988340f1 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -341,7 +341,6 @@ static VALUE *eval6(void) freev(i2); } return v; - } /* Handle : operator (pattern matching). diff --git a/coreutils/ls.c b/coreutils/ls.c index 1197f7d71..3e6980509 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -52,7 +52,6 @@ enum { - TERMINAL_WIDTH = 80, /* use 79 if terminal has linefold bug */ COLUMN_GAP = 2, /* includes the file type char */ @@ -120,7 +119,6 @@ LIST_LONG = LIST_MODEBITS | LIST_NLINKS | LIST_ID_NAME | LIST_SIZE | \ SPLIT_DIR = 1, SPLIT_FILE = 0, SPLIT_SUBDIR = 2, - }; /* "[-]Cadil1", POSIX mandated options, busybox always supports */ diff --git a/e2fsprogs/old_e2fsprogs/e2fsck.c b/e2fsprogs/old_e2fsprogs/e2fsck.c index 4c4c78d00..f58fe9286 100644 --- a/e2fsprogs/old_e2fsprogs/e2fsck.c +++ b/e2fsprogs/old_e2fsprogs/e2fsck.c @@ -517,7 +517,6 @@ static void dict_insert(dict_t *dict, dnode_t *node, const void *key) } dict_root(dict)->color = dnode_black; - } /* @@ -801,7 +800,6 @@ static void e2fsck_add_dx_dir(e2fsck_t ctx, ext2_ino_t ino, int num_blocks) dir->dx_block = e2fsck_allocate_memory(ctx, num_blocks * sizeof (struct dx_dirblock_info), "dx_block info array"); - } /* @@ -1724,7 +1722,6 @@ errout: ext2fs_free_mem(&j_inode); ext2fs_free_mem(&journal); return retval; - } static errcode_t e2fsck_journal_fix_bad_inode(e2fsck_t ctx, @@ -3375,7 +3372,6 @@ static void e2fsck_pass1(e2fsck_t ctx) e2fsck_write_inode(ctx, ino, inode, "pass1"); } - } /* * If dtime is set, offer to clear it. mke2fs @@ -3678,7 +3674,6 @@ endit: ext2fs_free_mem(&block_buf); ext2fs_free_mem(&inode); - } /* @@ -4451,8 +4446,7 @@ static void mark_table_blocks(e2fsck_t ctx) ctx->invalid_bitmaps++; } } else { - ext2fs_mark_block_bitmap(ctx->block_found_map, - b); + ext2fs_mark_block_bitmap(ctx->block_found_map, b); } } } @@ -4469,10 +4463,9 @@ static void mark_table_blocks(e2fsck_t ctx) ctx->invalid_bitmaps++; } } else { - ext2fs_mark_block_bitmap(ctx->block_found_map, - fs->group_desc[i].bg_block_bitmap); - } - + ext2fs_mark_block_bitmap(ctx->block_found_map, + fs->group_desc[i].bg_block_bitmap); + } } /* * Mark block used for the inode bitmap @@ -4486,8 +4479,8 @@ static void mark_table_blocks(e2fsck_t ctx) ctx->invalid_bitmaps++; } } else { - ext2fs_mark_block_bitmap(ctx->block_found_map, - fs->group_desc[i].bg_inode_bitmap); + ext2fs_mark_block_bitmap(ctx->block_found_map, + fs->group_desc[i].bg_inode_bitmap); } } block += fs->super->s_blocks_per_group; @@ -5588,7 +5581,6 @@ static void e2fsck_pass2(e2fsck_t ctx) ext2fs_mark_super_dirty(fs); } } - } #define MAX_DEPTH 32000 @@ -9748,7 +9740,6 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx) if (print_answer) printf("%s.\n", answer ? _(preen_msg[(int) ptr->prompt]) : _("IGNORED")); - } if ((ptr->prompt == PROMPT_ABORT) && answer) @@ -11324,7 +11315,7 @@ static int release_inode_block(ext2_filsys fs, blk_t *block_nr, if ((blk < fs->super->s_first_data_block) || (blk >= fs->super->s_blocks_count)) { fix_problem(ctx, PR_0_ORPHAN_ILLEGAL_BLOCK_NUM, pctx); - return_abort: + return_abort: pb->abort = 1; return BLOCK_ABORT; } @@ -11537,7 +11528,7 @@ static int release_orphan_inodes(e2fsck_t ctx) } ext2fs_free_mem(&block_buf); return 0; -return_abort: + return_abort: ext2fs_free_mem(&block_buf); return 1; } @@ -11618,7 +11609,7 @@ static void check_resize_inode(e2fsck_t ctx) !(inode.i_mode & LINUX_S_IFREG) || (blk < fs->super->s_first_data_block || blk >= fs->super->s_blocks_count)) { - resize_inode_invalid: + resize_inode_invalid: if (fix_problem(ctx, PR_0_RESIZE_INODE_INVALID, &pctx)) { memset(&inode, 0, sizeof(inode)); e2fsck_write_inode(ctx, EXT2_RESIZE_INO, &inode, @@ -11660,10 +11651,9 @@ static void check_resize_inode(e2fsck_t ctx) } } -cleanup: + cleanup: ext2fs_free_mem(&dind_buf); - - } +} static void check_super_block(e2fsck_t ctx) { @@ -11842,7 +11832,6 @@ static void check_super_block(e2fsck_t ctx) (gd->bg_free_inodes_count > sb->s_inodes_per_group) || (gd->bg_used_dirs_count > sb->s_inodes_per_group)) ext2fs_unmark_valid(fs); - } /* @@ -11902,7 +11891,6 @@ static void check_super_block(e2fsck_t ctx) fs->super->s_feature_incompat &= ~EXT2_FEATURE_INCOMPAT_FILETYPE; ext2fs_mark_super_dirty(fs); - } } diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/alloc.c b/e2fsprogs/old_e2fsprogs/ext2fs/alloc.c index 5021d72c9..cbb63e15a 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/alloc.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/alloc.c @@ -171,4 +171,3 @@ errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start, blk_t finish, } while (b != finish); return EXT2_ET_BLOCK_ALLOC_FAIL; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/alloc_tables.c b/e2fsprogs/old_e2fsprogs/ext2fs/alloc_tables.c index b2d786ed8..7c60e2bf5 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/alloc_tables.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/alloc_tables.c @@ -97,12 +97,9 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, fs->group_desc[group].bg_inode_table = new_blk; } - return 0; } - - errcode_t ext2fs_allocate_tables(ext2_filsys fs) { errcode_t retval; @@ -115,4 +112,3 @@ errcode_t ext2fs_allocate_tables(ext2_filsys fs) } return 0; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/bb_inode.c b/e2fsprogs/old_e2fsprogs/ext2fs/bb_inode.c index 1deae54e8..a96789618 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/bb_inode.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/bb_inode.c @@ -260,9 +260,3 @@ static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr, *block_nr = blk; return BLOCK_CHANGED; } - - - - - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c b/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c index 987061130..3cf157949 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c @@ -88,4 +88,3 @@ void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap, bb_error_msg("#%lu", arg); #endif } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/block.c b/e2fsprogs/old_e2fsprogs/ext2fs/block.c index 498096995..dbd04f846 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/block.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/block.c @@ -435,4 +435,3 @@ errcode_t ext2fs_block_iterate(ext2_filsys fs, return ext2fs_block_iterate2(fs, ino, BLOCK_FLAG_NO_LARGE | flags, block_buf, xlate_func, &xl); } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/bmap.c b/e2fsprogs/old_e2fsprogs/ext2fs/bmap.c index b2d0279d8..796b0e4f5 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/bmap.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/bmap.c @@ -259,6 +259,3 @@ done: } return retval; } - - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/bmove.c b/e2fsprogs/old_e2fsprogs/ext2fs/bmove.c index 635410da5..ec9244d0b 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/bmove.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/bmove.c @@ -153,4 +153,3 @@ errcode_t ext2fs_move_blocks(ext2_filsys fs, } return 0; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/brel.h b/e2fsprogs/old_e2fsprogs/ext2fs/brel.h index 216fd132c..87bf72be4 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/brel.h +++ b/e2fsprogs/old_e2fsprogs/ext2fs/brel.h @@ -84,4 +84,3 @@ errcode_t ext2fs_brel_memarray_create(char *name, blk_t max_block, #define ext2fs_brel_move(brel, old, new) ((brel)->move((brel), old, new)) #define ext2fs_brel_delete(brel, old) ((brel)->delete((brel), old)) #define ext2fs_brel_free(brel) ((brel)->free((brel))) - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/closefs.c b/e2fsprogs/old_e2fsprogs/ext2fs/closefs.c index 7ba7f22e2..bfa15e22a 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/closefs.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/closefs.c @@ -378,4 +378,3 @@ errcode_t ext2fs_close(ext2_filsys fs) ext2fs_free(fs); return 0; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/cmp_bitmaps.c b/e2fsprogs/old_e2fsprogs/ext2fs/cmp_bitmaps.c index 05b8eb8d7..7f78ff804 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/cmp_bitmaps.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/cmp_bitmaps.c @@ -70,4 +70,3 @@ errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1, return 0; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/dir_iterate.c b/e2fsprogs/old_e2fsprogs/ext2fs/dir_iterate.c index b7d873595..eb5dae0a6 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/dir_iterate.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/dir_iterate.c @@ -217,4 +217,3 @@ next: return BLOCK_ABORT; return 0; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/dirblock.c b/e2fsprogs/old_e2fsprogs/ext2fs/dirblock.c index f651338e3..f9c5a104b 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/dirblock.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/dirblock.c @@ -130,4 +130,3 @@ errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block, { return ext2fs_write_dir_block2(fs, block, inbuf, 0); } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/dupfs.c b/e2fsprogs/old_e2fsprogs/ext2fs/dupfs.c index 203c29fe3..d1879377a 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/dupfs.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/dupfs.c @@ -92,6 +92,4 @@ errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest) errout: ext2fs_free(fs); return retval; - } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/e2image.h b/e2fsprogs/old_e2fsprogs/ext2fs/e2image.h index 8d38ecc13..a598d0111 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/e2image.h +++ b/e2fsprogs/old_e2fsprogs/ext2fs/e2image.h @@ -37,16 +37,3 @@ struct ext2_image_hdr { __u32 offset_blockmap; /* Byte offset of the inode bitmaps */ __u32 offset_reserved[8]; }; - - - - - - - - - - - - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_ext_attr.h b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_ext_attr.h index cc91bb8d6..ca309c0d0 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_ext_attr.h +++ b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_ext_attr.h @@ -50,4 +50,3 @@ struct ext2_ext_attr_entry { sizeof(struct ext2_xattr_entry)) & ~EXT2_EXT_ATTR_ROUND) #define EXT2_XATTR_SIZE(size) \ (((size) + EXT2_EXT_ATTR_ROUND) & ~EXT2_EXT_ATTR_ROUND) - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ext2fsP.h b/e2fsprogs/old_e2fsprogs/ext2fs/ext2fsP.h index 908b5d9a4..7a02e9a8e 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/ext2fsP.h +++ b/e2fsprogs/old_e2fsprogs/ext2fs/ext2fsP.h @@ -85,5 +85,3 @@ extern int ext2fs_process_dir_block(ext2_filsys fs, blk_t ref_block, int ref_offset, void *priv_data); - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/freefs.c b/e2fsprogs/old_e2fsprogs/ext2fs/freefs.c index 65c4ee794..0c5d48b11 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/freefs.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/freefs.c @@ -125,4 +125,3 @@ void ext2fs_free_dblist(ext2_dblist dblist) dblist->magic = 0; ext2fs_free_mem(&dblist); } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/get_pathname.c b/e2fsprogs/old_e2fsprogs/ext2fs/get_pathname.c index a98b2b9e5..a3bbad851 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/get_pathname.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/get_pathname.c @@ -153,5 +153,4 @@ errcode_t ext2fs_get_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino, retval = ext2fs_get_pathname_int(fs, dir, ino, 32, buf, name); ext2fs_free_mem(&buf); return retval; - } diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ind_block.c b/e2fsprogs/old_e2fsprogs/ext2fs/ind_block.c index c86a1c59a..a1038300b 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/ind_block.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/ind_block.c @@ -67,5 +67,3 @@ errcode_t ext2fs_write_ind_block(ext2_filsys fs, blk_t blk, void *buf) #endif return io_channel_write_blk(fs->io, blk, 1, buf); } - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/inline.c b/e2fsprogs/old_e2fsprogs/ext2fs/inline.c index 9b620a772..d328cc950 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/inline.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/inline.c @@ -30,4 +30,3 @@ #include "ext2_fs.h" #define INCLUDE_INLINE_FUNCS #include "ext2fs.h" - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/inode.c b/e2fsprogs/old_e2fsprogs/ext2fs/inode.c index 5e0d081bd..7a1d5c94b 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/inode.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/inode.c @@ -764,4 +764,3 @@ errcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino) return EXT2_ET_NO_DIRECTORY; return 0; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/inode_io.c b/e2fsprogs/old_e2fsprogs/ext2fs/inode_io.c index 4bfa93aef..b861d5ff6 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/inode_io.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/inode_io.c @@ -268,4 +268,3 @@ static errcode_t inode_flush(io_channel channel) return ext2fs_file_flush(data->file); } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/jfs_dat.h b/e2fsprogs/old_e2fsprogs/ext2fs/jfs_dat.h index 136635de0..17c586a29 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/jfs_dat.h +++ b/e2fsprogs/old_e2fsprogs/ext2fs/jfs_dat.h @@ -60,6 +60,4 @@ typedef struct journal_superblock_s /* Dynamic information describing the current state of the log */ __u32 s_sequence; /* first commit ID expected in log */ __u32 s_start; /* blocknr of start of log */ - } journal_superblock_t; - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/lookup.c b/e2fsprogs/old_e2fsprogs/ext2fs/lookup.c index 31b30a182..b2e8de8ec 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/lookup.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/lookup.c @@ -66,5 +66,3 @@ errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name, return (ls.found) ? 0 : EXT2_ET_FILE_NOT_FOUND; } - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/mkdir.c b/e2fsprogs/old_e2fsprogs/ext2fs/mkdir.c index 93f47b06f..a86ac8e93 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/mkdir.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/mkdir.c @@ -136,7 +136,4 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum, cleanup: ext2fs_free_mem(&block); return retval; - } - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/mkjournal.c b/e2fsprogs/old_e2fsprogs/ext2fs/mkjournal.c index db1c8bff3..748d9abc7 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/mkjournal.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/mkjournal.c @@ -188,7 +188,6 @@ static int mkjournal_proc(ext2_filsys fs, return (BLOCK_CHANGED | BLOCK_ABORT); else return BLOCK_CHANGED; - } /* @@ -423,6 +422,5 @@ main(int argc, char **argv) } ext2fs_close(fs); exit(0); - } #endif diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/namei.c b/e2fsprogs/old_e2fsprogs/ext2fs/namei.c index 14d48fb72..18244613c 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/namei.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/namei.c @@ -202,4 +202,3 @@ errcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, ext2fs_free_mem(&buf); return retval; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c b/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c index 9470e7f56..9f156626d 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c @@ -66,7 +66,6 @@ errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino, dir->name_len = 2 | filetype; dir->name[0] = '.'; dir->name[1] = '.'; - } *block = buf; return 0; diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/read_bb.c b/e2fsprogs/old_e2fsprogs/ext2fs/read_bb.c index 4766157c2..ce77bc9f6 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/read_bb.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/read_bb.c @@ -94,5 +94,3 @@ errcode_t ext2fs_read_bb_inode(ext2_filsys fs, ext2_badblocks_list *bb_list) return rb.err; } - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/read_bb_file.c b/e2fsprogs/old_e2fsprogs/ext2fs/read_bb_file.c index 831adcc3a..bf1fc328b 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/read_bb_file.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/read_bb_file.c @@ -94,5 +94,3 @@ errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, return ext2fs_read_bb_FILE2(fs, f, bb_list, (void *) invalid, call_compat_invalid); } - - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/res_gdt.c b/e2fsprogs/old_e2fsprogs/ext2fs/res_gdt.c index 3c550d511..403463a90 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/res_gdt.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/res_gdt.c @@ -218,4 +218,3 @@ out_free: ext2fs_free_mem((void *)&dindir_buf); return retval; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/rs_bitmap.c b/e2fsprogs/old_e2fsprogs/ext2fs/rs_bitmap.c index e932b3c9d..32e87b77a 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/rs_bitmap.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/rs_bitmap.c @@ -104,4 +104,3 @@ errcode_t ext2fs_resize_block_bitmap(__u32 new_end, __u32 new_real_end, bmap->magic = EXT2_ET_MAGIC_BLOCK_BITMAP; return retval; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/rw_bitmaps.c b/e2fsprogs/old_e2fsprogs/ext2fs/rw_bitmaps.c index 0ae0a8234..b618acc5b 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/rw_bitmaps.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/rw_bitmaps.c @@ -293,4 +293,3 @@ errcode_t ext2fs_write_bitmaps(ext2_filsys fs) } return 0; } - diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/swapfs.c b/e2fsprogs/old_e2fsprogs/ext2fs/swapfs.c index 2fca3cfbb..07b757abd 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/swapfs.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/swapfs.c @@ -66,7 +66,6 @@ void ext2fs_swap_super(struct ext2_super_block * sb) sb->s_hash_seed[i] = ext2fs_swab32(sb->s_hash_seed[i]); for (i=0; i < 17; i++) sb->s_jnl_blocks[i] = ext2fs_swab32(sb->s_jnl_blocks[i]); - } void ext2fs_swap_group_desc(struct ext2_group_desc *gdp) @@ -222,7 +221,6 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t, ext2fs_swap_ext_attr((char *) (eat + 1), (char *) (eaf + 1), bufsize - sizeof(struct ext2_inode) - t->i_extra_isize - sizeof(__u32), 0); - } void ext2fs_swap_inode(ext2_filsys fs, struct ext2_inode *t, diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/unlink.c b/e2fsprogs/old_e2fsprogs/ext2fs/unlink.c index 83ac2713e..71a9ffcb9 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/unlink.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/unlink.c @@ -97,4 +97,3 @@ errcode_t ext2fs_unlink(ext2_filsys fs, ext2_ino_t dir, return (ls.done) ? 0 : EXT2_ET_DIR_NO_SPACE; } - diff --git a/e2fsprogs/old_e2fsprogs/util.c b/e2fsprogs/old_e2fsprogs/util.c index 64cca05a7..0829f5686 100644 --- a/e2fsprogs/old_e2fsprogs/util.c +++ b/e2fsprogs/old_e2fsprogs/util.c @@ -95,7 +95,6 @@ force_check: bb_error_msg("%s is apparently in use by the system", device); goto force_check; } - } void parse_journal_opts(char **journal_device, int *journal_flags, diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index 215e4a9e0..78ca22585 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c @@ -168,7 +168,6 @@ int addgroup_main(int argc UNUSED_PARAM, char **argv) { die_if_bad_username(argv[0]); new_group(argv[0], gid); - } /* Reached only on success */ return EXIT_SUCCESS; diff --git a/miscutils/crond.c b/miscutils/crond.c index 66110bb85..d028eb089 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c @@ -243,7 +243,6 @@ static void ParseField(char *user, char *ary, int modvalue, int off, goto err; } } while (n1 != n2); - } if (*ptr != ',') { break; diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 9738620fd..236b1749c 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c @@ -730,8 +730,8 @@ static void identify(uint16_t *val) if (val[MINOR] && (val[MINOR] <= MINOR_MAX)) { if (like_std < 3) like_std = 3; std = actual_ver[val[MINOR]]; - if (std) printf("\n\tUsed: %s ", nth_string(minor_str, val[MINOR])); - + if (std) + printf("\n\tUsed: %s ", nth_string(minor_str, val[MINOR])); } /* looks like when they up-issue the std, they obsolete one; * thus, only the newest 4 issues need be supported. (That's diff --git a/networking/ntpd.c b/networking/ntpd.c index 14c3a5fbb..d00ee49e5 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -592,7 +592,6 @@ filter_datapoints(peer_t *p) p->filter_offset, x, p->filter_dispersion, p->filter_jitter); - } static void diff --git a/networking/telnet.c b/networking/telnet.c index 57997f6b9..e0022b2cb 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -150,7 +150,6 @@ static void con_escape(void) cookmode(); ret: bb_got_signal = 0; - } static void handle_net_output(int len) diff --git a/networking/traceroute.c b/networking/traceroute.c index 2d3e77011..c18fba8d0 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -666,7 +666,6 @@ packet_ok(int read_len, len_and_sockaddr *from_lsa, return (type == ICMP6_TIME_EXCEEDED ? -1 : (code<<8)+1); } } - } # if ENABLE_FEATURE_TRACEROUTE_VERBOSE diff --git a/selinux/setfiles.c b/selinux/setfiles.c index f45e41b2b..989510e3d 100644 --- a/selinux/setfiles.c +++ b/selinux/setfiles.c @@ -118,7 +118,6 @@ static void add_exclude(const char *directory) if (directory == NULL || directory[0] != '/') { bb_error_msg_and_die("full path required for exclude: %s", directory); - } if (lstat(directory, &sb)) { bb_error_msg("directory \"%s\" not found, ignoring", directory); diff --git a/shell/ash.c b/shell/ash.c index 988edab8a..d8becc37a 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -11215,7 +11215,6 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) } IF_ASH_ALIAS(if (c != PEOA)) USTPUTC(c, out); - } c = pgetc_fast(); } /* for (;;) */ @@ -12055,7 +12054,6 @@ evalcmd(int argc UNUSED_PARAM, char **argv) p = grabstackstr(concat); } evalstring(p, ~SKIPEVAL); - } return exitstatus; } diff --git a/shell/hush.c b/shell/hush.c index 45c98bb36..0a420f685 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -4518,7 +4518,6 @@ static NOINLINE int run_pipe(struct pipe *pi) #ifdef CMD_SINGLEWORD_NOGLOB_COND else if (command->cmd_type == CMD_SINGLEWORD_NOGLOB_COND) { argv_expanded = expand_strvec_to_strvec_singleword_noglob_cond(argv + command->assignment_cnt); - } #endif else { diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index aa718c787..fc02000e5 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -2043,7 +2043,6 @@ fix_partition_table_order(void) fix_chain_of_logicals(); printf("Done.\n"); - } #endif diff --git a/util-linux/volume_id/volume_id.c b/util-linux/volume_id/volume_id.c index c8cf946df..f41d4e0d9 100644 --- a/util-linux/volume_id/volume_id.c +++ b/util-linux/volume_id/volume_id.c @@ -195,7 +195,6 @@ int FAST_FUNC volume_id_probe_all(struct volume_id *id, /*uint64_t off,*/ uint64 ret: volume_id_free_buffer(id); return (- id->error); /* 0 or -1 */ - } /* open volume by device node */ -- cgit v1.2.3-55-g6feb From 138ce54c9c1930348bc842be781accd7c50c2cef Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Fri, 30 Jul 2010 06:01:37 +0200 Subject: stty: sort out preprocessor conditionals * Move the definitions of missing constants to the top of the file. * Fix undefined IDX_xxx on missing termios constants. * FreeBSD has TABDLY, TAB0 and TAB3, but no TAB1 or TAB2 * Omit the definition of set_window_size() if TIOCGWINSZ is not available. Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- coreutils/Config.src | 1 - coreutils/stty.c | 339 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 214 insertions(+), 126 deletions(-) (limited to 'coreutils') diff --git a/coreutils/Config.src b/coreutils/Config.src index 780b73fda..0eb70af55 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src @@ -607,7 +607,6 @@ config FEATURE_STAT_FORMAT config STTY bool "stty" default y - depends on PLATFORM_LINUX help stty is used to change and print terminal line settings. diff --git a/coreutils/stty.c b/coreutils/stty.c index c40d718af..33f7b21dd 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -115,6 +115,113 @@ # define CSTATUS Control('t') #endif +/* Save us from #ifdef forest plague */ +#ifndef BSDLY +# define BSDLY 0 +#endif +#ifndef CIBAUD +# define CIBAUD 0 +#endif +#ifndef CRDLY +# define CRDLY 0 +#endif +#ifndef CRTSCTS +# define CRTSCTS 0 +#endif +#ifndef ECHOCTL +# define ECHOCTL 0 +#endif +#ifndef ECHOKE +# define ECHOKE 0 +#endif +#ifndef ECHOPRT +# define ECHOPRT 0 +#endif +#ifndef FFDLY +# define FFDLY 0 +#endif +#ifndef IEXTEN +# define IEXTEN 0 +#endif +#ifndef IMAXBEL +# define IMAXBEL 0 +#endif +#ifndef IUCLC +# define IUCLC 0 +#endif +#ifndef IXANY +# define IXANY 0 +#endif +#ifndef NLDLY +# define NLDLY 0 +#endif +#ifndef OCRNL +# define OCRNL 0 +#endif +#ifndef OFDEL +# define OFDEL 0 +#endif +#ifndef OFILL +# define OFILL 0 +#endif +#ifndef OLCUC +# define OLCUC 0 +#endif +#ifndef ONLCR +# define ONLCR 0 +#endif +#ifndef ONLRET +# define ONLRET 0 +#endif +#ifndef ONOCR +# define ONOCR 0 +#endif +#ifndef OXTABS +# define OXTABS 0 +#endif +#ifndef TABDLY +# define TABDLY 0 +#endif +#ifndef TAB1 +# define TAB1 0 +#endif +#ifndef TAB2 +# define TAB2 0 +#endif +#ifndef TOSTOP +# define TOSTOP 0 +#endif +#ifndef VDSUSP +# define VDSUSP 0 +#endif +#ifndef VEOL2 +# define VEOL2 0 +#endif +#ifndef VFLUSHO +# define VFLUSHO 0 +#endif +#ifndef VLNEXT +# define VLNEXT 0 +#endif +#ifndef VREPRINT +# define VREPRINT 0 +#endif +#ifndef VSTATUS +# define VSTATUS 0 +#endif +#ifndef VSWTCH +# define VSWTCH 0 +#endif +#ifndef VTDLY +# define VTDLY 0 +#endif +#ifndef VWERASE +# define VWERASE 0 +#endif +#ifndef XCASE +# define XCASE 0 +#endif + /* Which speeds to set */ enum speed_setting { input_speed, output_speed, both_speeds @@ -167,13 +274,13 @@ enum { IDX_cbreak, IDX_crt, IDX_dec, -#ifdef IXANY +#if IXANY IDX_decctlq, #endif -#if defined(TABDLY) || defined(OXTABS) +#if TABDLY || OXTABS IDX_tabs, #endif -#if defined(XCASE) && defined(IUCLC) && defined(OLCUC) +#if XCASE && IUCLC && OLCUC IDX_lcase, IDX_LCASE, #endif @@ -196,13 +303,13 @@ static const char mode_name[] = MI_ENTRY("cbreak", combination, REV | OMIT, 0, 0 ) MI_ENTRY("crt", combination, OMIT, 0, 0 ) MI_ENTRY("dec", combination, OMIT, 0, 0 ) -#ifdef IXANY +#if IXANY MI_ENTRY("decctlq", combination, REV | OMIT, 0, 0 ) #endif -#if defined(TABDLY) || defined(OXTABS) +#if TABDLY || OXTABS MI_ENTRY("tabs", combination, REV | OMIT, 0, 0 ) #endif -#if defined(XCASE) && defined(IUCLC) && defined(OLCUC) +#if XCASE && IUCLC && OLCUC MI_ENTRY("lcase", combination, REV | OMIT, 0, 0 ) MI_ENTRY("LCASE", combination, REV | OMIT, 0, 0 ) #endif @@ -217,7 +324,7 @@ static const char mode_name[] = MI_ENTRY("cstopb", control, REV, CSTOPB, 0 ) MI_ENTRY("cread", control, SANE_SET | REV, CREAD, 0 ) MI_ENTRY("clocal", control, REV, CLOCAL, 0 ) -#ifdef CRTSCTS +#if CRTSCTS MI_ENTRY("crtscts", control, REV, CRTSCTS, 0 ) #endif MI_ENTRY("ignbrk", input, SANE_UNSET | REV, IGNBRK, 0 ) @@ -232,74 +339,78 @@ static const char mode_name[] = MI_ENTRY("ixon", input, REV, IXON, 0 ) MI_ENTRY("ixoff", input, SANE_UNSET | REV, IXOFF, 0 ) MI_ENTRY("tandem", input, REV | OMIT, IXOFF, 0 ) -#ifdef IUCLC +#if IUCLC MI_ENTRY("iuclc", input, SANE_UNSET | REV, IUCLC, 0 ) #endif -#ifdef IXANY +#if IXANY MI_ENTRY("ixany", input, SANE_UNSET | REV, IXANY, 0 ) #endif -#ifdef IMAXBEL +#if IMAXBEL MI_ENTRY("imaxbel", input, SANE_SET | REV, IMAXBEL, 0 ) #endif MI_ENTRY("opost", output, SANE_SET | REV, OPOST, 0 ) -#ifdef OLCUC +#if OLCUC MI_ENTRY("olcuc", output, SANE_UNSET | REV, OLCUC, 0 ) #endif -#ifdef OCRNL +#if OCRNL MI_ENTRY("ocrnl", output, SANE_UNSET | REV, OCRNL, 0 ) #endif -#ifdef ONLCR +#if ONLCR MI_ENTRY("onlcr", output, SANE_SET | REV, ONLCR, 0 ) #endif -#ifdef ONOCR +#if ONOCR MI_ENTRY("onocr", output, SANE_UNSET | REV, ONOCR, 0 ) #endif -#ifdef ONLRET +#if ONLRET MI_ENTRY("onlret", output, SANE_UNSET | REV, ONLRET, 0 ) #endif -#ifdef OFILL +#if OFILL MI_ENTRY("ofill", output, SANE_UNSET | REV, OFILL, 0 ) #endif -#ifdef OFDEL +#if OFDEL MI_ENTRY("ofdel", output, SANE_UNSET | REV, OFDEL, 0 ) #endif -#ifdef NLDLY +#if NLDLY MI_ENTRY("nl1", output, SANE_UNSET, NL1, NLDLY) MI_ENTRY("nl0", output, SANE_SET, NL0, NLDLY) #endif -#ifdef CRDLY +#if CRDLY MI_ENTRY("cr3", output, SANE_UNSET, CR3, CRDLY) MI_ENTRY("cr2", output, SANE_UNSET, CR2, CRDLY) MI_ENTRY("cr1", output, SANE_UNSET, CR1, CRDLY) MI_ENTRY("cr0", output, SANE_SET, CR0, CRDLY) #endif -#ifdef TABDLY +#if TABDLY MI_ENTRY("tab3", output, SANE_UNSET, TAB3, TABDLY) +# if TAB2 MI_ENTRY("tab2", output, SANE_UNSET, TAB2, TABDLY) +# endif +# if TAB1 MI_ENTRY("tab1", output, SANE_UNSET, TAB1, TABDLY) +# endif MI_ENTRY("tab0", output, SANE_SET, TAB0, TABDLY) #else -# ifdef OXTABS +# if OXTABS MI_ENTRY("tab3", output, SANE_UNSET, OXTABS, 0 ) # endif #endif -#ifdef BSDLY +#if BSDLY MI_ENTRY("bs1", output, SANE_UNSET, BS1, BSDLY) MI_ENTRY("bs0", output, SANE_SET, BS0, BSDLY) #endif -#ifdef VTDLY +#if VTDLY MI_ENTRY("vt1", output, SANE_UNSET, VT1, VTDLY) MI_ENTRY("vt0", output, SANE_SET, VT0, VTDLY) #endif -#ifdef FFDLY +#if FFDLY MI_ENTRY("ff1", output, SANE_UNSET, FF1, FFDLY) MI_ENTRY("ff0", output, SANE_SET, FF0, FFDLY) #endif MI_ENTRY("isig", local, SANE_SET | REV, ISIG, 0 ) MI_ENTRY("icanon", local, SANE_SET | REV, ICANON, 0 ) -#ifdef IEXTEN +#if IEXTEN MI_ENTRY("iexten", local, SANE_SET | REV, IEXTEN, 0 ) #endif MI_ENTRY("echo", local, SANE_SET | REV, ECHO, 0 ) @@ -308,21 +419,21 @@ static const char mode_name[] = MI_ENTRY("echok", local, SANE_SET | REV, ECHOK, 0 ) MI_ENTRY("echonl", local, SANE_UNSET | REV, ECHONL, 0 ) MI_ENTRY("noflsh", local, SANE_UNSET | REV, NOFLSH, 0 ) -#ifdef XCASE +#if XCASE MI_ENTRY("xcase", local, SANE_UNSET | REV, XCASE, 0 ) #endif -#ifdef TOSTOP +#if TOSTOP MI_ENTRY("tostop", local, SANE_UNSET | REV, TOSTOP, 0 ) #endif -#ifdef ECHOPRT +#if ECHOPRT MI_ENTRY("echoprt", local, SANE_UNSET | REV, ECHOPRT, 0 ) MI_ENTRY("prterase", local, REV | OMIT, ECHOPRT, 0 ) #endif -#ifdef ECHOCTL +#if ECHOCTL MI_ENTRY("echoctl", local, SANE_SET | REV, ECHOCTL, 0 ) MI_ENTRY("ctlecho", local, REV | OMIT, ECHOCTL, 0 ) #endif -#ifdef ECHOKE +#if ECHOKE MI_ENTRY("echoke", local, SANE_SET | REV, ECHOKE, 0 ) MI_ENTRY("crtkill", local, REV | OMIT, ECHOKE, 0 ) #endif @@ -346,13 +457,13 @@ static const struct mode_info mode_info[] = { MI_ENTRY("cbreak", combination, REV | OMIT, 0, 0 ) MI_ENTRY("crt", combination, OMIT, 0, 0 ) MI_ENTRY("dec", combination, OMIT, 0, 0 ) -#ifdef IXANY +#if IXANY MI_ENTRY("decctlq", combination, REV | OMIT, 0, 0 ) #endif -#if defined(TABDLY) || defined(OXTABS) +#if TABDLY || OXTABS MI_ENTRY("tabs", combination, REV | OMIT, 0, 0 ) #endif -#if defined(XCASE) && defined(IUCLC) && defined(OLCUC) +#if XCASE && IUCLC && OLCUC MI_ENTRY("lcase", combination, REV | OMIT, 0, 0 ) MI_ENTRY("LCASE", combination, REV | OMIT, 0, 0 ) #endif @@ -367,7 +478,7 @@ static const struct mode_info mode_info[] = { MI_ENTRY("cstopb", control, REV, CSTOPB, 0 ) MI_ENTRY("cread", control, SANE_SET | REV, CREAD, 0 ) MI_ENTRY("clocal", control, REV, CLOCAL, 0 ) -#ifdef CRTSCTS +#if CRTSCTS MI_ENTRY("crtscts", control, REV, CRTSCTS, 0 ) #endif MI_ENTRY("ignbrk", input, SANE_UNSET | REV, IGNBRK, 0 ) @@ -382,74 +493,78 @@ static const struct mode_info mode_info[] = { MI_ENTRY("ixon", input, REV, IXON, 0 ) MI_ENTRY("ixoff", input, SANE_UNSET | REV, IXOFF, 0 ) MI_ENTRY("tandem", input, REV | OMIT, IXOFF, 0 ) -#ifdef IUCLC +#if IUCLC MI_ENTRY("iuclc", input, SANE_UNSET | REV, IUCLC, 0 ) #endif -#ifdef IXANY +#if IXANY MI_ENTRY("ixany", input, SANE_UNSET | REV, IXANY, 0 ) #endif -#ifdef IMAXBEL +#if IMAXBEL MI_ENTRY("imaxbel", input, SANE_SET | REV, IMAXBEL, 0 ) #endif MI_ENTRY("opost", output, SANE_SET | REV, OPOST, 0 ) -#ifdef OLCUC +#if OLCUC MI_ENTRY("olcuc", output, SANE_UNSET | REV, OLCUC, 0 ) #endif -#ifdef OCRNL +#if OCRNL MI_ENTRY("ocrnl", output, SANE_UNSET | REV, OCRNL, 0 ) #endif -#ifdef ONLCR +#if ONLCR MI_ENTRY("onlcr", output, SANE_SET | REV, ONLCR, 0 ) #endif -#ifdef ONOCR +#if ONOCR MI_ENTRY("onocr", output, SANE_UNSET | REV, ONOCR, 0 ) #endif -#ifdef ONLRET +#if ONLRET MI_ENTRY("onlret", output, SANE_UNSET | REV, ONLRET, 0 ) #endif -#ifdef OFILL +#if OFILL MI_ENTRY("ofill", output, SANE_UNSET | REV, OFILL, 0 ) #endif -#ifdef OFDEL +#if OFDEL MI_ENTRY("ofdel", output, SANE_UNSET | REV, OFDEL, 0 ) #endif -#ifdef NLDLY +#if NLDLY MI_ENTRY("nl1", output, SANE_UNSET, NL1, NLDLY) MI_ENTRY("nl0", output, SANE_SET, NL0, NLDLY) #endif -#ifdef CRDLY +#if CRDLY MI_ENTRY("cr3", output, SANE_UNSET, CR3, CRDLY) MI_ENTRY("cr2", output, SANE_UNSET, CR2, CRDLY) MI_ENTRY("cr1", output, SANE_UNSET, CR1, CRDLY) MI_ENTRY("cr0", output, SANE_SET, CR0, CRDLY) #endif -#ifdef TABDLY +#if TABDLY MI_ENTRY("tab3", output, SANE_UNSET, TAB3, TABDLY) +# if TAB2 MI_ENTRY("tab2", output, SANE_UNSET, TAB2, TABDLY) +# endif +# if TAB1 MI_ENTRY("tab1", output, SANE_UNSET, TAB1, TABDLY) +# endif MI_ENTRY("tab0", output, SANE_SET, TAB0, TABDLY) #else -# ifdef OXTABS +# if OXTABS MI_ENTRY("tab3", output, SANE_UNSET, OXTABS, 0 ) # endif #endif -#ifdef BSDLY +#if BSDLY MI_ENTRY("bs1", output, SANE_UNSET, BS1, BSDLY) MI_ENTRY("bs0", output, SANE_SET, BS0, BSDLY) #endif -#ifdef VTDLY +#if VTDLY MI_ENTRY("vt1", output, SANE_UNSET, VT1, VTDLY) MI_ENTRY("vt0", output, SANE_SET, VT0, VTDLY) #endif -#ifdef FFDLY +#if FFDLY MI_ENTRY("ff1", output, SANE_UNSET, FF1, FFDLY) MI_ENTRY("ff0", output, SANE_SET, FF0, FFDLY) #endif MI_ENTRY("isig", local, SANE_SET | REV, ISIG, 0 ) MI_ENTRY("icanon", local, SANE_SET | REV, ICANON, 0 ) -#ifdef IEXTEN +#if IEXTEN MI_ENTRY("iexten", local, SANE_SET | REV, IEXTEN, 0 ) #endif MI_ENTRY("echo", local, SANE_SET | REV, ECHO, 0 ) @@ -458,21 +573,21 @@ static const struct mode_info mode_info[] = { MI_ENTRY("echok", local, SANE_SET | REV, ECHOK, 0 ) MI_ENTRY("echonl", local, SANE_UNSET | REV, ECHONL, 0 ) MI_ENTRY("noflsh", local, SANE_UNSET | REV, NOFLSH, 0 ) -#ifdef XCASE +#if XCASE MI_ENTRY("xcase", local, SANE_UNSET | REV, XCASE, 0 ) #endif -#ifdef TOSTOP +#if TOSTOP MI_ENTRY("tostop", local, SANE_UNSET | REV, TOSTOP, 0 ) #endif -#ifdef ECHOPRT +#if ECHOPRT MI_ENTRY("echoprt", local, SANE_UNSET | REV, ECHOPRT, 0 ) MI_ENTRY("prterase", local, REV | OMIT, ECHOPRT, 0 ) #endif -#ifdef ECHOCTL +#if ECHOCTL MI_ENTRY("echoctl", local, SANE_SET | REV, ECHOCTL, 0 ) MI_ENTRY("ctlecho", local, REV | OMIT, ECHOCTL, 0 ) #endif -#ifdef ECHOKE +#if ECHOKE MI_ENTRY("echoke", local, SANE_SET | REV, ECHOKE, 0 ) MI_ENTRY("crtkill", local, REV | OMIT, ECHOKE, 0 ) #endif @@ -497,31 +612,31 @@ enum { CIDX_kill, CIDX_eof, CIDX_eol, -#ifdef VEOL2 +#if VEOL2 CIDX_eol2, #endif -#ifdef VSWTCH +#if VSWTCH CIDX_swtch, #endif CIDX_start, CIDX_stop, CIDX_susp, -#ifdef VDSUSP +#if VDSUSP CIDX_dsusp, #endif -#ifdef VREPRINT +#if VREPRINT CIDX_rprnt, #endif -#ifdef VWERASE +#if VWERASE CIDX_werase, #endif -#ifdef VLNEXT +#if VLNEXT CIDX_lnext, #endif -#ifdef VFLUSHO +#if VFLUSHO CIDX_flush, #endif -#ifdef VSTATUS +#if VSTATUS CIDX_status, #endif CIDX_min, @@ -538,31 +653,31 @@ static const char control_name[] = CI_ENTRY("kill", CKILL, VKILL ) CI_ENTRY("eof", CEOF, VEOF ) CI_ENTRY("eol", CEOL, VEOL ) -#ifdef VEOL2 +#if VEOL2 CI_ENTRY("eol2", CEOL2, VEOL2 ) #endif -#ifdef VSWTCH +#if VSWTCH CI_ENTRY("swtch", CSWTCH, VSWTCH ) #endif CI_ENTRY("start", CSTART, VSTART ) CI_ENTRY("stop", CSTOP, VSTOP ) CI_ENTRY("susp", CSUSP, VSUSP ) -#ifdef VDSUSP +#if VDSUSP CI_ENTRY("dsusp", CDSUSP, VDSUSP ) #endif -#ifdef VREPRINT +#if VREPRINT CI_ENTRY("rprnt", CRPRNT, VREPRINT) #endif -#ifdef VWERASE +#if VWERASE CI_ENTRY("werase", CWERASE, VWERASE ) #endif -#ifdef VLNEXT +#if VLNEXT CI_ENTRY("lnext", CLNEXT, VLNEXT ) #endif -#ifdef VFLUSHO +#if VFLUSHO CI_ENTRY("flush", CFLUSHO, VFLUSHO ) #endif -#ifdef VSTATUS +#if VSTATUS CI_ENTRY("status", CSTATUS, VSTATUS ) #endif /* These must be last because of the display routines */ @@ -581,31 +696,31 @@ static const struct control_info control_info[] = { CI_ENTRY("kill", CKILL, VKILL ) CI_ENTRY("eof", CEOF, VEOF ) CI_ENTRY("eol", CEOL, VEOL ) -#ifdef VEOL2 +#if VEOL2 CI_ENTRY("eol2", CEOL2, VEOL2 ) #endif -#ifdef VSWTCH +#if VSWTCH CI_ENTRY("swtch", CSWTCH, VSWTCH ) #endif CI_ENTRY("start", CSTART, VSTART ) CI_ENTRY("stop", CSTOP, VSTOP ) CI_ENTRY("susp", CSUSP, VSUSP ) -#ifdef VDSUSP +#if VDSUSP CI_ENTRY("dsusp", CDSUSP, VDSUSP ) #endif -#ifdef VREPRINT +#if VREPRINT CI_ENTRY("rprnt", CRPRNT, VREPRINT) #endif -#ifdef VWERASE +#if VWERASE CI_ENTRY("werase", CWERASE, VWERASE ) #endif -#ifdef VLNEXT +#if VLNEXT CI_ENTRY("lnext", CLNEXT, VLNEXT ) #endif -#ifdef VFLUSHO +#if VFLUSHO CI_ENTRY("flush", CFLUSHO, VFLUSHO ) #endif -#ifdef VSTATUS +#if VSTATUS CI_ENTRY("status", CSTATUS, VSTATUS ) #endif /* These must be last because of the display routines */ @@ -740,6 +855,7 @@ static void newline(void) wrapf("\n"); } +#ifdef TIOCGWINSZ static void set_window_size(int rows, int cols) { struct winsize win = { 0, 0, 0, 0 }; @@ -760,6 +876,7 @@ static void set_window_size(int rows, int cols) bail: perror_on_device("%s"); } +#endif static void display_window_size(int fancy) { @@ -973,41 +1090,6 @@ static void sane_mode(struct termios *mode) } } -/* Save set_mode from #ifdef forest plague */ -#ifndef ONLCR -#define ONLCR 0 -#endif -#ifndef OCRNL -#define OCRNL 0 -#endif -#ifndef ONLRET -#define ONLRET 0 -#endif -#ifndef XCASE -#define XCASE 0 -#endif -#ifndef IXANY -#define IXANY 0 -#endif -#ifndef TABDLY -#define TABDLY 0 -#endif -#ifndef OXTABS -#define OXTABS 0 -#endif -#ifndef IUCLC -#define IUCLC 0 -#endif -#ifndef OLCUC -#define OLCUC 0 -#endif -#ifndef ECHOCTL -#define ECHOCTL 0 -#endif -#ifndef ECHOKE -#define ECHOKE 0 -#endif - static void set_mode(const struct mode_info *info, int reversed, struct termios *mode) { @@ -1093,27 +1175,32 @@ static void set_mode(const struct mode_info *info, int reversed, mode->c_cc[VTIME] = 0; } } - else if (IXANY && info == &mode_info[IDX_decctlq]) { +#if IXANY + else if (info == &mode_info[IDX_decctlq]) { if (reversed) mode->c_iflag |= IXANY; else mode->c_iflag &= ~IXANY; } - else if (TABDLY && info == &mode_info[IDX_tabs]) { +#endif +#if TABDLY + else if (info == &mode_info[IDX_tabs]) { if (reversed) mode->c_oflag = (mode->c_oflag & ~TABDLY) | TAB3; else mode->c_oflag = (mode->c_oflag & ~TABDLY) | TAB0; } - else if (OXTABS && info == &mode_info[IDX_tabs]) { +#endif +#if OXTABS + else if (info == &mode_info[IDX_tabs]) { if (reversed) mode->c_oflag |= OXTABS; else mode->c_oflag &= ~OXTABS; - } else - if (XCASE && IUCLC && OLCUC - && (info == &mode_info[IDX_lcase] || info == &mode_info[IDX_LCASE]) - ) { + } +#endif +#if XCASE && IUCLC && OLCUC + else if (info==&mode_info[IDX_lcase] || info==&mode_info[IDX_LCASE]) { if (reversed) { mode->c_lflag &= ~XCASE; mode->c_iflag &= ~IUCLC; @@ -1123,7 +1210,9 @@ static void set_mode(const struct mode_info *info, int reversed, mode->c_iflag |= IUCLC; mode->c_oflag |= OLCUC; } - } else if (info == &mode_info[IDX_crt]) { + } +#endif + else if (info == &mode_info[IDX_crt]) { mode->c_lflag |= ECHOE | ECHOCTL | ECHOKE; } else if (info == &mode_info[IDX_dec]) { mode->c_cc[VINTR] = 3; /* ^C */ @@ -1419,7 +1508,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv) perror_on_device_and_die("%s"); if (memcmp(&mode, &new_mode, sizeof(mode)) != 0) { -#ifdef CIBAUD +#if CIBAUD /* SunOS 4.1.3 (at least) has the problem that after this sequence, tcgetattr (&m1); tcsetattr (&m1); tcgetattr (&m2); sometimes (m1 != m2). The only difference is in the four bits -- cgit v1.2.3-55-g6feb