aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 13:57:26 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 13:57:26 +1000
commit0c9d2455301ed633826e222aacd930126990913e (patch)
tree2353a480f55dfa41d9e6d2fa328af1b60dd3653e /libbb
parente8db4fe96b3a68b6f971d88084ef2fd2c8513e78 (diff)
parent9dc04124d5a3f0c9be249287817a964691e187b0 (diff)
downloadbusybox-w32-0c9d2455301ed633826e222aacd930126990913e.tar.gz
busybox-w32-0c9d2455301ed633826e222aacd930126990913e.tar.bz2
busybox-w32-0c9d2455301ed633826e222aacd930126990913e.zip
Merge branch 'origin/master' (early part)
Diffstat (limited to 'libbb')
-rw-r--r--libbb/Kbuild.src2
-rw-r--r--libbb/appletlib.c4
-rw-r--r--libbb/ask_confirmation.c2
-rw-r--r--libbb/bb_askpass.c2
-rw-r--r--libbb/bb_basename.c2
-rw-r--r--libbb/bb_do_delay.c2
-rw-r--r--libbb/bb_pwd.c2
-rw-r--r--libbb/bb_qsort.c2
-rw-r--r--libbb/bb_strtod.c2
-rw-r--r--libbb/bb_strtonum.c2
-rw-r--r--libbb/chomp.c2
-rw-r--r--libbb/compare_string_array.c2
-rw-r--r--libbb/concat_path_file.c2
-rw-r--r--libbb/concat_subpath_file.c2
-rw-r--r--libbb/copy_file.c2
-rw-r--r--libbb/copyfd.c2
-rw-r--r--libbb/crc32.c2
-rw-r--r--libbb/create_icmp6_socket.c2
-rw-r--r--libbb/create_icmp_socket.c2
-rw-r--r--libbb/default_error_retval.c2
-rw-r--r--libbb/device_open.c2
-rw-r--r--libbb/die_if_bad_username.c2
-rw-r--r--libbb/dump.c6
-rw-r--r--libbb/execable.c2
-rw-r--r--libbb/fclose_nonstdin.c2
-rw-r--r--libbb/fflush_stdout_and_exit.c2
-rw-r--r--libbb/fgets_str.c2
-rw-r--r--libbb/find_mount_point.c2
-rw-r--r--libbb/find_pid_by_name.c2
-rw-r--r--libbb/find_root_device.c2
-rw-r--r--libbb/full_write.c2
-rw-r--r--libbb/get_console.c2
-rw-r--r--libbb/get_cpu_count.c2
-rw-r--r--libbb/get_last_path_component.c2
-rw-r--r--libbb/get_line_from_file.c2
-rw-r--r--libbb/get_volsize.c2
-rw-r--r--libbb/getopt32.c2
-rw-r--r--libbb/getpty.c2
-rw-r--r--libbb/herror_msg.c2
-rw-r--r--libbb/human_readable.c2
-rw-r--r--libbb/inet_common.c2
-rw-r--r--libbb/info_msg.c2
-rw-r--r--libbb/inode_hash.c2
-rw-r--r--libbb/isdirectory.c4
-rw-r--r--libbb/kernel_version.c2
-rw-r--r--libbb/last_char_is.c2
-rw-r--r--libbb/lineedit_ptr_hack.c2
-rw-r--r--libbb/llist.c2
-rw-r--r--libbb/login.c2
-rw-r--r--libbb/loop.c2
-rw-r--r--libbb/make_directory.c2
-rw-r--r--libbb/makedev.c2
-rw-r--r--libbb/match_fstype.c2
-rw-r--r--libbb/md5.c16
-rw-r--r--libbb/messages.c2
-rw-r--r--libbb/mode_string.c2
-rw-r--r--libbb/mtab.c2
-rw-r--r--libbb/mtab_file.c2
-rw-r--r--libbb/obscure.c80
-rw-r--r--libbb/parse_config.c2
-rw-r--r--libbb/parse_mode.c2
-rw-r--r--libbb/perror_msg.c2
-rw-r--r--libbb/perror_nomsg.c2
-rw-r--r--libbb/perror_nomsg_and_die.c2
-rw-r--r--libbb/pidfile.c2
-rw-r--r--libbb/platform.c2
-rw-r--r--libbb/print_flags.c2
-rw-r--r--libbb/printable.c2
-rw-r--r--libbb/printable_string.c2
-rw-r--r--libbb/process_escape_sequence.c2
-rw-r--r--libbb/procps.c162
-rw-r--r--libbb/ptr_to_globals.c2
-rw-r--r--libbb/pw_encrypt.c2
-rw-r--r--libbb/read.c2
-rw-r--r--libbb/read_key.c2
-rw-r--r--libbb/read_printf.c2
-rw-r--r--libbb/recursive_action.c2
-rw-r--r--libbb/remove_file.c2
-rw-r--r--libbb/rtc.c2
-rw-r--r--libbb/safe_gethostname.c2
-rw-r--r--libbb/safe_poll.c2
-rw-r--r--libbb/safe_strncpy.c2
-rw-r--r--libbb/safe_write.c2
-rw-r--r--libbb/selinux_common.c2
-rw-r--r--libbb/sha1.c2
-rw-r--r--libbb/signals.c2
-rw-r--r--libbb/simplify_path.c2
-rw-r--r--libbb/single_argv.c2
-rw-r--r--libbb/skip_whitespace.c2
-rw-r--r--libbb/speed_table.c2
-rw-r--r--libbb/str_tolower.c2
-rw-r--r--libbb/strrstr.c2
-rw-r--r--libbb/time.c2
-rw-r--r--libbb/trim.c2
-rw-r--r--libbb/u_signal_names.c2
-rw-r--r--libbb/udp_io.c2
-rw-r--r--libbb/unicode.c2
-rw-r--r--libbb/update_passwd.c4
-rw-r--r--libbb/utmp.c2
-rw-r--r--libbb/uuencode.c2
-rw-r--r--libbb/vdprintf.c2
-rw-r--r--libbb/verror_msg.c2
-rw-r--r--libbb/vfork_daemon_rexec.c2
-rw-r--r--libbb/warn_ignoring_args.c2
-rw-r--r--libbb/wfopen.c2
-rw-r--r--libbb/wfopen_input.c10
-rw-r--r--libbb/write.c2
-rw-r--r--libbb/xatonum.c2
-rw-r--r--libbb/xatonum_template.c2
-rw-r--r--libbb/xconnect.c2
-rw-r--r--libbb/xfunc_die.c2
-rw-r--r--libbb/xfuncs.c2
-rw-r--r--libbb/xfuncs_printf.c12
-rw-r--r--libbb/xgetcwd.c2
-rw-r--r--libbb/xgethostbyname.c2
-rw-r--r--libbb/xreadlink.c2
-rw-r--r--libbb/xrealloc_vector.c2
-rw-r--r--libbb/xregcomp.c2
118 files changed, 300 insertions, 216 deletions
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index a6a163f3e..4fbf486b5 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -2,7 +2,7 @@
2# 2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under GPLv2, see file LICENSE in this source tree.
6 6
7libbb/appletlib.o: include/usage_compressed.h 7libbb/appletlib.o: include/usage_compressed.h
8 8
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index b470f30f9..751000e5d 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -7,9 +7,9 @@
7 * here, please feel free to acknowledge your work. 7 * here, please feel free to acknowledge your work.
8 * 8 *
9 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell 9 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
10 * Permission has been granted to redistribute this code under the GPL. 10 * Permission has been granted to redistribute this code under GPL.
11 * 11 *
12 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 12 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
13 */ 13 */
14 14
15/* We are trying to not use printf, this benefits the case when selected 15/* We are trying to not use printf, this benefits the case when selected
diff --git a/libbb/ask_confirmation.c b/libbb/ask_confirmation.c
index e0e94195e..d95729cc9 100644
--- a/libbb/ask_confirmation.c
+++ b/libbb/ask_confirmation.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Read a line from stdin. If the first non-whitespace char is 'y' or 'Y', 10/* Read a line from stdin. If the first non-whitespace char is 'y' or 'Y',
diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c
index 12ebe179e..9a4188f52 100644
--- a/libbb/bb_askpass.c
+++ b/libbb/bb_askpass.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/bb_basename.c b/libbb/bb_basename.c
index cc9b246e3..92fdb6545 100644
--- a/libbb/bb_basename.c
+++ b/libbb/bb_basename.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2007 Denys Vlasenko 5 * Copyright (C) 2007 Denys Vlasenko
6 * 6 *
7 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/bb_do_delay.c b/libbb/bb_do_delay.c
index 139dc1878..05c879fb9 100644
--- a/libbb/bb_do_delay.c
+++ b/libbb/bb_do_delay.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2005 by Tito Ragusa <tito-wolit@tiscali.it> 5 * Copyright (C) 2005 by Tito Ragusa <tito-wolit@tiscali.it>
6 * 6 *
7 * Licensed under the GPL v2, see the file LICENSE in this tarball. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/bb_pwd.c b/libbb/bb_pwd.c
index d72857771..32406cb58 100644
--- a/libbb/bb_pwd.c
+++ b/libbb/bb_pwd.c
@@ -5,7 +5,7 @@
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * Copyright (C) 2008 by Tito Ragusa <farmatito@tiscali.it> 6 * Copyright (C) 2008 by Tito Ragusa <farmatito@tiscali.it>
7 * 7 *
8 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/bb_qsort.c b/libbb/bb_qsort.c
index 9773afa6e..a54e7236a 100644
--- a/libbb/bb_qsort.c
+++ b/libbb/bb_qsort.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (c) 2008 Denys Vlasenko 5 * Copyright (c) 2008 Denys Vlasenko
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/bb_strtod.c b/libbb/bb_strtod.c
index 1e9671029..5dde78414 100644
--- a/libbb/bb_strtod.c
+++ b/libbb/bb_strtod.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/bb_strtonum.c b/libbb/bb_strtonum.c
index 87cd744a7..c66c774f4 100644
--- a/libbb/bb_strtonum.c
+++ b/libbb/bb_strtonum.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/chomp.c b/libbb/chomp.c
index ed4bf6beb..cb92befb1 100644
--- a/libbb/chomp.c
+++ b/libbb/chomp.c
@@ -5,7 +5,7 @@
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index 599449fe0..4b10cc138 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
4 */ 4 */
5 5
6#include "libbb.h" 6#include "libbb.h"
diff --git a/libbb/concat_path_file.c b/libbb/concat_path_file.c
index fb533547e..9ed295996 100644
--- a/libbb/concat_path_file.c
+++ b/libbb/concat_path_file.c
@@ -5,7 +5,7 @@
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11/* Concatenate path and filename to new allocated buffer. 11/* Concatenate path and filename to new allocated buffer.
diff --git a/libbb/concat_subpath_file.c b/libbb/concat_subpath_file.c
index 313fa63cf..c9167d492 100644
--- a/libbb/concat_subpath_file.c
+++ b/libbb/concat_subpath_file.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) (C) 2003 Vladimir Oleynik <dzo@simtreas.ru> 5 * Copyright (C) (C) 2003 Vladimir Oleynik <dzo@simtreas.ru>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* 10/*
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 80a64f791..2134ee046 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -5,7 +5,7 @@
5 * Copyright (C) 2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu> 5 * Copyright (C) 2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
6 * SELinux support by Yuichi Nakamura <ynakam@hitachisoft.jp> 6 * SELinux support by Yuichi Nakamura <ynakam@hitachisoft.jp>
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10#include "libbb.h" 10#include "libbb.h"
11 11
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 82622c06f..eda2747f9 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/crc32.c b/libbb/crc32.c
index 36ac86042..520b1ffb9 100644
--- a/libbb/crc32.c
+++ b/libbb/crc32.c
@@ -13,7 +13,7 @@
13 * endian = 1: big-endian 13 * endian = 1: big-endian
14 * endian = 0: little-endian 14 * endian = 0: little-endian
15 * 15 *
16 * Licensed under GPLv2, see file LICENSE in this tarball for details. 16 * Licensed under GPLv2, see file LICENSE in this source tree.
17 */ 17 */
18 18
19#include "libbb.h" 19#include "libbb.h"
diff --git a/libbb/create_icmp6_socket.c b/libbb/create_icmp6_socket.c
index 91e478ec8..368c69028 100644
--- a/libbb/create_icmp6_socket.c
+++ b/libbb/create_icmp6_socket.c
@@ -5,7 +5,7 @@
5 * create raw socket for icmp (IPv6 version) protocol 5 * create raw socket for icmp (IPv6 version) protocol
6 * and drop root privileges if running setuid 6 * and drop root privileges if running setuid
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/create_icmp_socket.c b/libbb/create_icmp_socket.c
index d75f8452d..585626983 100644
--- a/libbb/create_icmp_socket.c
+++ b/libbb/create_icmp_socket.c
@@ -5,7 +5,7 @@
5 * create raw socket for icmp protocol 5 * create raw socket for icmp protocol
6 * and drop root privileges if running setuid 6 * and drop root privileges if running setuid
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/default_error_retval.c b/libbb/default_error_retval.c
index 0b19f2163..4da5b3efb 100644
--- a/libbb/default_error_retval.c
+++ b/libbb/default_error_retval.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 3 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
4 * 4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 5 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 */ 6 */
7 7
8/* Seems silly to copyright a global variable. ;-) Oh well. 8/* Seems silly to copyright a global variable. ;-) Oh well.
diff --git a/libbb/device_open.c b/libbb/device_open.c
index cf8bcf646..a8fe2fcb4 100644
--- a/libbb/device_open.c
+++ b/libbb/device_open.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/die_if_bad_username.c b/libbb/die_if_bad_username.c
index 8b4deec29..9946e3a1d 100644
--- a/libbb/die_if_bad_username.c
+++ b/libbb/die_if_bad_username.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2008 Tito Ragusa <farmatito@tiscali.it> 5 * Copyright (C) 2008 Tito Ragusa <farmatito@tiscali.it>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/dump.c b/libbb/dump.c
index 7a87219ba..4db3f06f0 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -6,7 +6,7 @@
6 * Copyright (c) 1989 6 * Copyright (c) 1989
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 * 8 *
9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 * 10 *
11 * Original copyright notice is retained at the end of this file. 11 * Original copyright notice is retained at the end of this file.
12 */ 12 */
@@ -323,9 +323,7 @@ static void do_skip(priv_dumper_t *dumper, const char *fname, int statok)
323 struct stat sbuf; 323 struct stat sbuf;
324 324
325 if (statok) { 325 if (statok) {
326 if (fstat(STDIN_FILENO, &sbuf)) { 326 xfstat(STDIN_FILENO, &sbuf, fname);
327 bb_simple_perror_msg_and_die(fname);
328 }
329 if (!(S_ISCHR(sbuf.st_mode) || S_ISBLK(sbuf.st_mode) || S_ISFIFO(sbuf.st_mode)) 327 if (!(S_ISCHR(sbuf.st_mode) || S_ISBLK(sbuf.st_mode) || S_ISFIFO(sbuf.st_mode))
330 && dumper->pub.dump_skip >= sbuf.st_size 328 && dumper->pub.dump_skip >= sbuf.st_size
331 ) { 329 ) {
diff --git a/libbb/execable.c b/libbb/execable.c
index de368fad0..3b144a730 100644
--- a/libbb/execable.c
+++ b/libbb/execable.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2006 Gabriel Somlo <somlo at cmu.edu> 5 * Copyright (C) 2006 Gabriel Somlo <somlo at cmu.edu>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/fclose_nonstdin.c b/libbb/fclose_nonstdin.c
index 6f3f37332..5ce9d5b48 100644
--- a/libbb/fclose_nonstdin.c
+++ b/libbb/fclose_nonstdin.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* A number of standard utilities can accept multiple command line args 10/* A number of standard utilities can accept multiple command line args
diff --git a/libbb/fflush_stdout_and_exit.c b/libbb/fflush_stdout_and_exit.c
index 742fb9f58..9ad5dbf96 100644
--- a/libbb/fflush_stdout_and_exit.c
+++ b/libbb/fflush_stdout_and_exit.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Attempt to fflush(stdout), and exit with an error code if stdout is 10/* Attempt to fflush(stdout), and exit with an error code if stdout is
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c
index 3fe61cdc3..89210a3c9 100644
--- a/libbb/fgets_str.c
+++ b/libbb/fgets_str.c
@@ -5,7 +5,7 @@
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/find_mount_point.c b/libbb/find_mount_point.c
index bcb18effe..361698a6b 100644
--- a/libbb/find_mount_point.c
+++ b/libbb/find_mount_point.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/find_pid_by_name.c b/libbb/find_pid_by_name.c
index 52a0c6dab..db823d05b 100644
--- a/libbb/find_pid_by_name.c
+++ b/libbb/find_pid_by_name.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c
index ca46bf535..32c86cea8 100644
--- a/libbb/find_root_device.c
+++ b/libbb/find_root_device.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/full_write.c b/libbb/full_write.c
index f353b7d55..a2abaee25 100644
--- a/libbb/full_write.c
+++ b/libbb/full_write.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/get_console.c b/libbb/get_console.c
index 74022b543..9b6407bd0 100644
--- a/libbb/get_console.c
+++ b/libbb/get_console.c
@@ -5,7 +5,7 @@
5 * Copyright (C) many different people. If you wrote this, please 5 * Copyright (C) many different people. If you wrote this, please
6 * acknowledge your work. 6 * acknowledge your work.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/get_cpu_count.c b/libbb/get_cpu_count.c
index edb7e6d37..ab468afdf 100644
--- a/libbb/get_cpu_count.c
+++ b/libbb/get_cpu_count.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2010 Marek Polacek <mmpolacek@gmail.com> 5 * Copyright (C) 2010 Marek Polacek <mmpolacek@gmail.com>
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/get_last_path_component.c b/libbb/get_last_path_component.c
index 7c99116e9..72598d22e 100644
--- a/libbb/get_last_path_component.c
+++ b/libbb/get_last_path_component.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2001 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index cbfb45b7c..a0ed9193f 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -6,7 +6,7 @@
6 * Copyright (C) 2004 Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 2004 Erik Andersen <andersen@codepoet.org>
7 * Copyright (C) 2001 Matt Krai 7 * Copyright (C) 2001 Matt Krai
8 * 8 *
9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
11 11
12#include "libbb.h" 12#include "libbb.h"
diff --git a/libbb/get_volsize.c b/libbb/get_volsize.c
index 5b0270968..241ceda9b 100644
--- a/libbb/get_volsize.c
+++ b/libbb/get_volsize.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2010 Denys Vlasenko 5 * Copyright (C) 2010 Denys Vlasenko
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index bcb2db645..ab77755fc 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003-2005 Vladimir Oleynik <dzo@simtreas.ru> 5 * Copyright (C) 2003-2005 Vladimir Oleynik <dzo@simtreas.ru>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include <getopt.h> 10#include <getopt.h>
diff --git a/libbb/getpty.c b/libbb/getpty.c
index 4bffd9ae6..ea653b0b6 100644
--- a/libbb/getpty.c
+++ b/libbb/getpty.c
@@ -3,7 +3,7 @@
3 * Mini getpty implementation for busybox 3 * Mini getpty implementation for busybox
4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) 4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com)
5 * 5 *
6 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 6 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 */ 7 */
8 8
9#include "libbb.h" 9#include "libbb.h"
diff --git a/libbb/herror_msg.c b/libbb/herror_msg.c
index ca9274cf7..d041076e0 100644
--- a/libbb/herror_msg.c
+++ b/libbb/herror_msg.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/human_readable.c b/libbb/human_readable.c
index 4228aaf42..22dc5d23f 100644
--- a/libbb/human_readable.c
+++ b/libbb/human_readable.c
@@ -25,7 +25,7 @@
25 * Some code to omit the decimal point and tenths digit is sketched out 25 * Some code to omit the decimal point and tenths digit is sketched out
26 * and "#if 0"'d below. 26 * and "#if 0"'d below.
27 * 27 *
28 * Licensed under GPLv2, see file LICENSE in this tarball for details. 28 * Licensed under GPLv2, see file LICENSE in this source tree.
29 */ 29 */
30 30
31#include "libbb.h" 31#include "libbb.h"
diff --git a/libbb/inet_common.c b/libbb/inet_common.c
index 0fc08d69d..b47259089 100644
--- a/libbb/inet_common.c
+++ b/libbb/inet_common.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Heavily modified by Manuel Novoa III Mar 12, 2001 6 * Heavily modified by Manuel Novoa III Mar 12, 2001
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/info_msg.c b/libbb/info_msg.c
index 81164faa0..56ca2efd4 100644
--- a/libbb/info_msg.c
+++ b/libbb/info_msg.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c
index b32bd26bf..2aea08b04 100644
--- a/libbb/inode_hash.c
+++ b/libbb/inode_hash.c
@@ -5,7 +5,7 @@
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/isdirectory.c b/libbb/isdirectory.c
index 4a2961e0d..9861be6f8 100644
--- a/libbb/isdirectory.c
+++ b/libbb/isdirectory.c
@@ -3,9 +3,9 @@
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell 5 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
6 * Permission has been granted to redistribute this code under the GPL. 6 * Permission has been granted to redistribute this code under GPL.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include <sys/stat.h> 11#include <sys/stat.h>
diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c
index cc237120d..a168a1e4e 100644
--- a/libbb/kernel_version.c
+++ b/libbb/kernel_version.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/last_char_is.c b/libbb/last_char_is.c
index b0592568c..65e6cdf04 100644
--- a/libbb/last_char_is.c
+++ b/libbb/last_char_is.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 Larry Doolittle, <ldoolitt@recycle.lbl.gov> 5 * Copyright (C) 2001 Larry Doolittle, <ldoolitt@recycle.lbl.gov>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/lineedit_ptr_hack.c b/libbb/lineedit_ptr_hack.c
index 53716a235..dc45855d5 100644
--- a/libbb/lineedit_ptr_hack.c
+++ b/libbb/lineedit_ptr_hack.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com> 3 * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com>
4 * 4 *
5 * Licensed under GPLv2, see file LICENSE in this tarball for details. 5 * Licensed under GPLv2, see file LICENSE in this source tree.
6 */ 6 */
7 7
8struct lineedit_statics; 8struct lineedit_statics;
diff --git a/libbb/llist.c b/libbb/llist.c
index 51b1ce6c9..ed84e6472 100644
--- a/libbb/llist.c
+++ b/libbb/llist.c
@@ -7,7 +7,7 @@
7 * Copyright (C) 2005 Bernhard Reutner-Fischer 7 * Copyright (C) 2005 Bernhard Reutner-Fischer
8 * Copyright (C) 2006 Rob Landley <rob@landley.net> 8 * Copyright (C) 2006 Rob Landley <rob@landley.net>
9 * 9 *
10 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
11 */ 11 */
12 12
13#include "libbb.h" 13#include "libbb.h"
diff --git a/libbb/login.c b/libbb/login.c
index 740c588f3..aa2e17164 100644
--- a/libbb/login.c
+++ b/libbb/login.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * Optimize and correcting OCRNL by Vladimir Oleynik <dzo@simtreas.ru> 7 * Optimize and correcting OCRNL by Vladimir Oleynik <dzo@simtreas.ru>
8 * 8 *
9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
11 11
12#include "libbb.h" 12#include "libbb.h"
diff --git a/libbb/loop.c b/libbb/loop.c
index eb7016d56..b798932fa 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -5,7 +5,7 @@
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * Copyright (C) 2005 by Rob Landley <rob@landley.net> 6 * Copyright (C) 2005 by Rob Landley <rob@landley.net>
7 * 7 *
8 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10#include "libbb.h" 10#include "libbb.h"
11#include <linux/version.h> 11#include <linux/version.h>
diff --git a/libbb/make_directory.c b/libbb/make_directory.c
index 4bb79bdf6..1095b49a3 100644
--- a/libbb/make_directory.c
+++ b/libbb/make_directory.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Mar 5, 2003 Manuel Novoa III 10/* Mar 5, 2003 Manuel Novoa III
diff --git a/libbb/makedev.c b/libbb/makedev.c
index ca71fdba6..cf59e616b 100644
--- a/libbb/makedev.c
+++ b/libbb/makedev.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2006 Denys Vlasenko 4 * Copyright (C) 2006 Denys Vlasenko
5 * 5 *
6 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */ 7 */
8 8
9/* We do not include libbb.h - #define makedev() is there! */ 9/* We do not include libbb.h - #define makedev() is there! */
diff --git a/libbb/match_fstype.c b/libbb/match_fstype.c
index 9360e757a..83d6e6770 100644
--- a/libbb/match_fstype.c
+++ b/libbb/match_fstype.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * Returns 1 for a match, otherwise 0 8 * Returns 1 for a match, otherwise 0
9 * 9 *
10 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
11 */ 11 */
12 12
13#include "libbb.h" 13#include "libbb.h"
diff --git a/libbb/md5.c b/libbb/md5.c
index a98631d0c..d8655ba91 100644
--- a/libbb/md5.c
+++ b/libbb/md5.c
@@ -1,16 +1,16 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * md5.c - Compute MD5 checksum of strings according to the 3 * md5.c - Compute MD5 checksum of strings according to the
4 * definition of MD5 in RFC 1321 from April 1992. 4 * definition of MD5 in RFC 1321 from April 1992.
5 * 5 *
6 * Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 6 * Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
7 * 7 *
8 * Copyright (C) 1995-1999 Free Software Foundation, Inc. 8 * Copyright (C) 1995-1999 Free Software Foundation, Inc.
9 * Copyright (C) 2001 Manuel Novoa III 9 * Copyright (C) 2001 Manuel Novoa III
10 * Copyright (C) 2003 Glenn L. McGrath 10 * Copyright (C) 2003 Glenn L. McGrath
11 * Copyright (C) 2003 Erik Andersen 11 * Copyright (C) 2003 Erik Andersen
12 * 12 *
13 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 13 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
14 */ 14 */
15 15
16#include "libbb.h" 16#include "libbb.h"
diff --git a/libbb/messages.c b/libbb/messages.c
index ffa8d00cd..0c13449c0 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 3 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4 * 4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 5 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 */ 6 */
7 7
8#include "libbb.h" 8#include "libbb.h"
diff --git a/libbb/mode_string.c b/libbb/mode_string.c
index 7d4e514b1..f1afe7d61 100644
--- a/libbb/mode_string.c
+++ b/libbb/mode_string.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Aug 13, 2003 10/* Aug 13, 2003
diff --git a/libbb/mtab.c b/libbb/mtab.c
index 586a66196..22bff6490 100644
--- a/libbb/mtab.c
+++ b/libbb/mtab.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include <mntent.h> 10#include <mntent.h>
diff --git a/libbb/mtab_file.c b/libbb/mtab_file.c
index c9d9a695e..add990ded 100644
--- a/libbb/mtab_file.c
+++ b/libbb/mtab_file.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/obscure.c b/libbb/obscure.c
index 19b87523e..dd8cd319a 100644
--- a/libbb/obscure.c
+++ b/libbb/obscure.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2006 Tito Ragusa <farmatito@tiscali.it> 5 * Copyright (C) 2006 Tito Ragusa <farmatito@tiscali.it>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* A good password: 10/* A good password:
@@ -45,53 +45,59 @@ static int string_checker_helper(const char *p1, const char *p2) __attribute__ (
45 45
46static int string_checker_helper(const char *p1, const char *p2) 46static int string_checker_helper(const char *p1, const char *p2)
47{ 47{
48 /* as-is or capitalized */
49 if (strcasecmp(p1, p2) == 0
50 /* as sub-string */ 48 /* as sub-string */
51 || strcasestr(p2, p1) != NULL 49 if (strcasestr(p2, p1) != NULL
52 /* invert in case haystack is shorter than needle */ 50 /* invert in case haystack is shorter than needle */
53 || strcasestr(p1, p2) != NULL) 51 || strcasestr(p1, p2) != NULL
52 /* as-is or capitalized */
53 /* || strcasecmp(p1, p2) == 0 - 1st strcasestr should catch this too */
54 ) {
54 return 1; 55 return 1;
56 }
55 return 0; 57 return 0;
56} 58}
57 59
58static int string_checker(const char *p1, const char *p2) 60static int string_checker(const char *p1, const char *p2)
59{ 61{
60 int size; 62 int size, i;
61 /* check string */ 63 /* check string */
62 int ret = string_checker_helper(p1, p2); 64 int ret = string_checker_helper(p1, p2);
63 /* Make our own copy */ 65 /* make our own copy */
64 char *p = xstrdup(p1); 66 char *p = xstrdup(p1);
65 /* reverse string */
66 size = strlen(p);
67 67
68 while (size--) { 68 /* reverse string */
69 *p = p1[size]; 69 i = size = strlen(p1);
70 p++; 70 while (--i >= 0) {
71 *p++ = p1[i];
71 } 72 }
72 /* restore pointer */ 73 p -= size; /* restore pointer */
73 p -= strlen(p1); 74
74 /* check reversed string */ 75 /* check reversed string */
75 ret |= string_checker_helper(p, p2); 76 ret |= string_checker_helper(p, p2);
77
76 /* clean up */ 78 /* clean up */
77 memset(p, 0, strlen(p1)); 79 memset(p, 0, size);
78 free(p); 80 free(p);
81
79 return ret; 82 return ret;
80} 83}
81 84
82#define LOWERCASE 1 85#define CATEGORIES 4
83#define UPPERCASE 2 86
84#define NUMBERS 4 87#define LOWERCASE 1
85#define SPECIAL 8 88#define UPPERCASE 2
89#define NUMBERS 4
90#define SPECIAL 8
91
92#define LAST_CAT 8
86 93
87static const char *obscure_msg(const char *old_p, const char *new_p, const struct passwd *pw) 94static const char *obscure_msg(const char *old_p, const char *new_p, const struct passwd *pw)
88{ 95{
89 int i; 96 unsigned length;
90 int c; 97 unsigned size;
91 int length; 98 unsigned mixed;
92 int mixed = 0; 99 unsigned c;
93 /* Add 2 for each type of characters to the minlen of password */ 100 unsigned i;
94 int size = CONFIG_PASSWORD_MINLEN + 8;
95 const char *p; 101 const char *p;
96 char *hostname; 102 char *hostname;
97 103
@@ -104,7 +110,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc
104 return "similar to username"; 110 return "similar to username";
105 } 111 }
106 /* no gecos as-is, as sub-string, reversed, capitalized, doubled */ 112 /* no gecos as-is, as sub-string, reversed, capitalized, doubled */
107 if (*pw->pw_gecos && string_checker(new_p, pw->pw_gecos)) { 113 if (pw->pw_gecos[0] && string_checker(new_p, pw->pw_gecos)) {
108 return "similar to gecos"; 114 return "similar to gecos";
109 } 115 }
110 /* hostname as-is, as sub-string, reversed, capitalized, doubled */ 116 /* hostname as-is, as sub-string, reversed, capitalized, doubled */
@@ -115,6 +121,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc
115 return "similar to hostname"; 121 return "similar to hostname";
116 122
117 /* Should / Must contain a mix of: */ 123 /* Should / Must contain a mix of: */
124 mixed = 0;
118 for (i = 0; i < length; i++) { 125 for (i = 0; i < length; i++) {
119 if (islower(new_p[i])) { /* a-z */ 126 if (islower(new_p[i])) { /* a-z */
120 mixed |= LOWERCASE; 127 mixed |= LOWERCASE;
@@ -125,7 +132,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc
125 } else { /* special characters */ 132 } else { /* special characters */
126 mixed |= SPECIAL; 133 mixed |= SPECIAL;
127 } 134 }
128 /* More than 50% similar characters ? */ 135 /* Count i'th char */
129 c = 0; 136 c = 0;
130 p = new_p; 137 p = new_p;
131 while (1) { 138 while (1) {
@@ -134,26 +141,31 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc
134 break; 141 break;
135 } 142 }
136 c++; 143 c++;
137 if (!++p) { 144 p++;
138 break; /* move past the matched char if possible */ 145 if (!*p) {
146 break;
139 } 147 }
140 } 148 }
141 149 /* More than 50% similar characters ? */
142 if (c >= (length / 2)) { 150 if (c*2 >= length) {
143 return "too many similar characters"; 151 return "too many similar characters";
144 } 152 }
145 } 153 }
146 for (i=0; i<4; i++) 154
147 if (mixed & (1<<i)) size -= 2; 155 size = CONFIG_PASSWORD_MINLEN + 2*CATEGORIES;
156 for (i = 1; i <= LAST_CAT; i <<= 1)
157 if (mixed & i)
158 size -= 2;
148 if (length < size) 159 if (length < size)
149 return "too weak"; 160 return "too weak";
150 161
151 if (old_p && old_p[0] != '\0') { 162 if (old_p && old_p[0]) {
152 /* check vs. old password */ 163 /* check vs. old password */
153 if (string_checker(new_p, old_p)) { 164 if (string_checker(new_p, old_p)) {
154 return "similar to old password"; 165 return "similar to old password";
155 } 166 }
156 } 167 }
168
157 return NULL; 169 return NULL;
158} 170}
159 171
diff --git a/libbb/parse_config.c b/libbb/parse_config.c
index b7c3a00e0..3fff9f212 100644
--- a/libbb/parse_config.c
+++ b/libbb/parse_config.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com> 5 * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 * Also for use in uClibc (http://uclibc.org/) licensed under LGPLv2.1 or later. 8 * Also for use in uClibc (http://uclibc.org/) licensed under LGPLv2.1 or later.
9 */ 9 */
10 10
diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c
index 6eca00ab1..8ea89163c 100644
--- a/libbb/parse_mode.c
+++ b/libbb/parse_mode.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* http://www.opengroup.org/onlinepubs/007904975/utilities/chmod.html */ 10/* http://www.opengroup.org/onlinepubs/007904975/utilities/chmod.html */
diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c
index cbba805fb..fa1f0d339 100644
--- a/libbb/perror_msg.c
+++ b/libbb/perror_msg.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/perror_nomsg.c b/libbb/perror_nomsg.c
index a157caa1f..a2a11cc8e 100644
--- a/libbb/perror_nomsg.c
+++ b/libbb/perror_nomsg.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* gcc warns about a null format string, therefore we provide 10/* gcc warns about a null format string, therefore we provide
diff --git a/libbb/perror_nomsg_and_die.c b/libbb/perror_nomsg_and_die.c
index d56e05d32..543ff5178 100644
--- a/libbb/perror_nomsg_and_die.c
+++ b/libbb/perror_nomsg_and_die.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* gcc warns about a null format string, therefore we provide 10/* gcc warns about a null format string, therefore we provide
diff --git a/libbb/pidfile.c b/libbb/pidfile.c
index 7b8fee21c..a48dfc38b 100644
--- a/libbb/pidfile.c
+++ b/libbb/pidfile.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2007 by Stephane Billiart <stephane.billiart@gmail.com> 5 * Copyright (C) 2007 by Stephane Billiart <stephane.billiart@gmail.com>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Override ENABLE_FEATURE_PIDFILE */ 10/* Override ENABLE_FEATURE_PIDFILE */
diff --git a/libbb/platform.c b/libbb/platform.c
index 67048648f..30d06e3a7 100644
--- a/libbb/platform.c
+++ b/libbb/platform.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2009 by Dan Fandrich <dan@coneharvesters.com>, et. al. 5 * Copyright (C) 2009 by Dan Fandrich <dan@coneharvesters.com>, et. al.
6 * 6 *
7 * Licensed under the GPL version 2, see the file LICENSE in this tarball. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/print_flags.c b/libbb/print_flags.c
index 9639dc6f3..eaec731e5 100644
--- a/libbb/print_flags.c
+++ b/libbb/print_flags.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2008 Natanael Copa <natanael.copa@gmail.com> 4 * Copyright (C) 2008 Natanael Copa <natanael.copa@gmail.com>
5 * 5 *
6 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 6 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 */ 7 */
8#include "libbb.h" 8#include "libbb.h"
9 9
diff --git a/libbb/printable.c b/libbb/printable.c
index ae9335932..f6ada4904 100644
--- a/libbb/printable.c
+++ b/libbb/printable.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2007 Denys Vlasenko 5 * Copyright (C) 2007 Denys Vlasenko
6 * 6 *
7 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/printable_string.c b/libbb/printable_string.c
index 83a482196..a316f60de 100644
--- a/libbb/printable_string.c
+++ b/libbb/printable_string.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2010 Denys Vlasenko 5 * Copyright (C) 2010 Denys Vlasenko
6 * 6 *
7 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10#include "unicode.h" 10#include "unicode.h"
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c
index 3ad908b57..82cbe10dc 100644
--- a/libbb/process_escape_sequence.c
+++ b/libbb/process_escape_sequence.c
@@ -5,7 +5,7 @@
5 * Copyright (C) Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) Manuel Novoa III <mjn3@codepoet.org>
6 * and Vladimir Oleynik <dzo@simtreas.ru> 6 * and Vladimir Oleynik <dzo@simtreas.ru>
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/procps.c b/libbb/procps.c
index 48e60a792..14d4481bd 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -6,7 +6,7 @@
6 * Copyright (C) 2002 by Vladimir Oleynik <dzo@simtreas.ru> 6 * Copyright (C) 2002 by Vladimir Oleynik <dzo@simtreas.ru>
7 * SELinux support: (c) 2007 by Yuichi Nakamura <ynakam@hitachisoft.jp> 7 * SELinux support: (c) 2007 by Yuichi Nakamura <ynakam@hitachisoft.jp>
8 * 8 *
9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
11 11
12#include "libbb.h" 12#include "libbb.h"
@@ -137,12 +137,9 @@ static unsigned long fast_strtoul_16(char **endptr)
137 *endptr = str; /* We skip trailing space! */ 137 *endptr = str; /* We skip trailing space! */
138 return n; 138 return n;
139} 139}
140/* TOPMEM uses fast_strtoul_10, so... */
141# undef ENABLE_FEATURE_FAST_TOP
142# define ENABLE_FEATURE_FAST_TOP 1
143#endif 140#endif
144 141
145#if ENABLE_FEATURE_FAST_TOP 142#if ENABLE_FEATURE_FAST_TOP || ENABLE_FEATURE_TOPMEM || ENABLE_PMAP
146/* We cut a lot of corners here for speed */ 143/* We cut a lot of corners here for speed */
147static unsigned long fast_strtoul_10(char **endptr) 144static unsigned long fast_strtoul_10(char **endptr)
148{ 145{
@@ -177,6 +174,111 @@ static char *skip_fields(char *str, int count)
177} 174}
178#endif 175#endif
179 176
177#if ENABLE_FEATURE_TOPMEM || ENABLE_PMAP
178int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total,
179 void (*cb)(struct smaprec *, void *), void *data)
180{
181 FILE *file;
182 struct smaprec currec;
183 char filename[sizeof("/proc/%u/smaps") + sizeof(int)*3];
184 char buf[PROCPS_BUFSIZE];
185#if !ENABLE_PMAP
186 void (*cb)(struct smaprec *, void *) = NULL;
187 void *data = NULL;
188#endif
189
190 sprintf(filename, "/proc/%u/smaps", (int)pid);
191
192 file = fopen_for_read(filename);
193 if (!file)
194 return 1;
195
196 memset(&currec, 0, sizeof(currec));
197 while (fgets(buf, PROCPS_BUFSIZE, file)) {
198 // Each mapping datum has this form:
199 // f7d29000-f7d39000 rw-s ADR M:m OFS FILE
200 // Size: nnn kB
201 // Rss: nnn kB
202 // .....
203
204 char *tp = buf, *p;
205
206#define SCAN(S, X) \
207 if (strncmp(tp, S, sizeof(S)-1) == 0) { \
208 tp = skip_whitespace(tp + sizeof(S)-1); \
209 total->X += currec.X = fast_strtoul_10(&tp); \
210 continue; \
211 }
212 if (cb) {
213 SCAN("Pss:" , smap_pss );
214 SCAN("Swap:" , smap_swap );
215 }
216 SCAN("Private_Dirty:", private_dirty);
217 SCAN("Private_Clean:", private_clean);
218 SCAN("Shared_Dirty:" , shared_dirty );
219 SCAN("Shared_Clean:" , shared_clean );
220#undef SCAN
221 tp = strchr(buf, '-');
222 if (tp) {
223 // We reached next mapping - the line of this form:
224 // f7d29000-f7d39000 rw-s ADR M:m OFS FILE
225
226 if (cb) {
227 /* If we have a previous record, there's nothing more
228 * for it, call the callback and clear currec
229 */
230 if (currec.smap_size)
231 cb(&currec, data);
232 free(currec.smap_name);
233 }
234 memset(&currec, 0, sizeof(currec));
235
236 *tp = ' ';
237 tp = buf;
238 currec.smap_start = fast_strtoul_16(&tp);
239 currec.smap_size = (fast_strtoul_16(&tp) - currec.smap_start) >> 10;
240
241 strncpy(currec.smap_mode, tp, sizeof(currec.smap_mode)-1);
242
243 // skipping "rw-s ADR M:m OFS "
244 tp = skip_whitespace(skip_fields(tp, 4));
245 // filter out /dev/something (something != zero)
246 if (strncmp(tp, "/dev/", 5) != 0 || strcmp(tp, "/dev/zero\n") == 0) {
247 if (currec.smap_mode[1] == 'w') {
248 currec.mapped_rw = currec.smap_size;
249 total->mapped_rw += currec.smap_size;
250 } else if (currec.smap_mode[1] == '-') {
251 currec.mapped_ro = currec.smap_size;
252 total->mapped_ro += currec.smap_size;
253 }
254 }
255
256 if (strcmp(tp, "[stack]\n") == 0)
257 total->stack += currec.smap_size;
258 if (cb) {
259 p = skip_non_whitespace(tp);
260 if (p == tp) {
261 currec.smap_name = xstrdup(" [ anon ]");
262 } else {
263 *p = '\0';
264 currec.smap_name = xstrdup(tp);
265 }
266 }
267 total->smap_size += currec.smap_size;
268 }
269 }
270 fclose(file);
271
272 if (cb) {
273 if (currec.smap_size)
274 cb(&currec, data);
275 free(currec.smap_name);
276 }
277
278 return 0;
279}
280#endif
281
180void BUG_comm_size(void); 282void BUG_comm_size(void);
181procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags) 283procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags)
182{ 284{
@@ -365,54 +467,8 @@ procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags)
365 } 467 }
366 468
367#if ENABLE_FEATURE_TOPMEM 469#if ENABLE_FEATURE_TOPMEM
368 if (flags & (PSSCAN_SMAPS)) { 470 if (flags & PSSCAN_SMAPS)
369 FILE *file; 471 procps_read_smaps(pid, &sp->smaps, NULL, NULL);
370
371 strcpy(filename_tail, "smaps");
372 file = fopen_for_read(filename);
373 if (file) {
374 while (fgets(buf, sizeof(buf), file)) {
375 unsigned long sz;
376 char *tp;
377 char w;
378#define SCAN(str, name) \
379 if (strncmp(buf, str, sizeof(str)-1) == 0) { \
380 tp = skip_whitespace(buf + sizeof(str)-1); \
381 sp->name += fast_strtoul_10(&tp); \
382 continue; \
383 }
384 SCAN("Shared_Clean:" , shared_clean );
385 SCAN("Shared_Dirty:" , shared_dirty );
386 SCAN("Private_Clean:", private_clean);
387 SCAN("Private_Dirty:", private_dirty);
388#undef SCAN
389 // f7d29000-f7d39000 rw-s ADR M:m OFS FILE
390 tp = strchr(buf, '-');
391 if (tp) {
392 *tp = ' ';
393 tp = buf;
394 sz = fast_strtoul_16(&tp); /* start */
395 sz = (fast_strtoul_16(&tp) - sz) >> 10; /* end - start */
396 // tp -> "rw-s" string
397 w = tp[1];
398 // skipping "rw-s ADR M:m OFS "
399 tp = skip_whitespace(skip_fields(tp, 4));
400 // filter out /dev/something (something != zero)
401 if (strncmp(tp, "/dev/", 5) != 0 || strcmp(tp, "/dev/zero\n") == 0) {
402 if (w == 'w') {
403 sp->mapped_rw += sz;
404 } else if (w == '-') {
405 sp->mapped_ro += sz;
406 }
407 }
408//else printf("DROPPING %s (%s)\n", buf, tp);
409 if (strcmp(tp, "[stack]\n") == 0)
410 sp->stack += sz;
411 }
412 }
413 fclose(file);
414 }
415 }
416#endif /* TOPMEM */ 472#endif /* TOPMEM */
417#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS 473#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
418 if (flags & PSSCAN_RUIDGID) { 474 if (flags & PSSCAN_RUIDGID) {
diff --git a/libbb/ptr_to_globals.c b/libbb/ptr_to_globals.c
index 5f30e2a64..1074538f3 100644
--- a/libbb/ptr_to_globals.c
+++ b/libbb/ptr_to_globals.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com> 3 * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com>
4 * 4 *
5 * Licensed under GPLv2, see file LICENSE in this tarball for details. 5 * Licensed under GPLv2, see file LICENSE in this source tree.
6 */ 6 */
7 7
8#include <errno.h> 8#include <errno.h>
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
index 6fc0ba87c..c6c04d44a 100644
--- a/libbb/pw_encrypt.c
+++ b/libbb/pw_encrypt.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/read.c b/libbb/read.c
index 1ed7c5f92..5906bc225 100644
--- a/libbb/read.c
+++ b/libbb/read.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/read_key.c b/libbb/read_key.c
index 64557ab14..840325c99 100644
--- a/libbb/read_key.c
+++ b/libbb/read_key.c
@@ -5,7 +5,7 @@
5 * Copyright (C) 2008 Rob Landley <rob@landley.net> 5 * Copyright (C) 2008 Rob Landley <rob@landley.net>
6 * Copyright (C) 2008 Denys Vlasenko <vda.linux@googlemail.com> 6 * Copyright (C) 2008 Denys Vlasenko <vda.linux@googlemail.com>
7 * 7 *
8 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10#include "libbb.h" 10#include "libbb.h"
11 11
diff --git a/libbb/read_printf.c b/libbb/read_printf.c
index 1b215f97a..7ca3d68c3 100644
--- a/libbb/read_printf.c
+++ b/libbb/read_printf.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index 57262cd43..b5cf7c0ab 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/remove_file.c b/libbb/remove_file.c
index da1488544..c6531a0b9 100644
--- a/libbb/remove_file.c
+++ b/libbb/remove_file.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu> 5 * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/rtc.c b/libbb/rtc.c
index 97d18ed53..97455e86a 100644
--- a/libbb/rtc.c
+++ b/libbb/rtc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Common RTC functions 2 * Common RTC functions
3 * 3 *
4 * Licensed under GPLv2, see file LICENSE in this tarball for details. 4 * Licensed under GPLv2, see file LICENSE in this source tree.
5 */ 5 */
6 6
7#include "libbb.h" 7#include "libbb.h"
diff --git a/libbb/safe_gethostname.c b/libbb/safe_gethostname.c
index 05e095448..bdb989631 100644
--- a/libbb/safe_gethostname.c
+++ b/libbb/safe_gethostname.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2008 Tito Ragusa <farmatito@tiscali.it> 5 * Copyright (C) 2008 Tito Ragusa <farmatito@tiscali.it>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* 10/*
diff --git a/libbb/safe_poll.c b/libbb/safe_poll.c
index 58c7bda5a..b492a8151 100644
--- a/libbb/safe_poll.c
+++ b/libbb/safe_poll.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2007 by Denys Vlasenko <vda.linux@googlemail.com> 5 * Copyright (C) 2007 by Denys Vlasenko <vda.linux@googlemail.com>
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/safe_strncpy.c b/libbb/safe_strncpy.c
index 4acd9766b..8eb6a014f 100644
--- a/libbb/safe_strncpy.c
+++ b/libbb/safe_strncpy.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/safe_write.c b/libbb/safe_write.c
index e3561f3cf..8f7628016 100644
--- a/libbb/safe_write.c
+++ b/libbb/safe_write.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/selinux_common.c b/libbb/selinux_common.c
index 2acb50e96..62910e285 100644
--- a/libbb/selinux_common.c
+++ b/libbb/selinux_common.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright 2007 KaiGai Kohei <kaigai@kaigai.gr.jp> 5 * Copyright 2007 KaiGai Kohei <kaigai@kaigai.gr.jp>
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10#include <selinux/context.h> 10#include <selinux/context.h>
diff --git a/libbb/sha1.c b/libbb/sha1.c
index 5f42532cd..beeb70cf6 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -7,7 +7,7 @@
7 * Copyright (C) 2003 Glenn L. McGrath 7 * Copyright (C) 2003 Glenn L. McGrath
8 * Copyright (C) 2003 Erik Andersen 8 * Copyright (C) 2003 Erik Andersen
9 * 9 *
10 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
11 * 11 *
12 * --------------------------------------------------------------------------- 12 * ---------------------------------------------------------------------------
13 * Issue Date: 10/11/2002 13 * Issue Date: 10/11/2002
diff --git a/libbb/signals.c b/libbb/signals.c
index a528756ff..cdc37b1ef 100644
--- a/libbb/signals.c
+++ b/libbb/signals.c
@@ -6,7 +6,7 @@
6 * Copyright (C) 2006 Rob Landley 6 * Copyright (C) 2006 Rob Landley
7 * Copyright (C) 2006 Denys Vlasenko 7 * Copyright (C) 2006 Denys Vlasenko
8 * 8 *
9 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11 11
12#include "libbb.h" 12#include "libbb.h"
diff --git a/libbb/simplify_path.c b/libbb/simplify_path.c
index f80e3e8a5..3818d32be 100644
--- a/libbb/simplify_path.c
+++ b/libbb/simplify_path.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2001 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/single_argv.c b/libbb/single_argv.c
index 6173c884e..85137b40f 100644
--- a/libbb/single_argv.c
+++ b/libbb/single_argv.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2009 Denys Vlasenko 5 * Copyright (C) 2009 Denys Vlasenko
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c
index f5a61a3cf..8c7b674c3 100644
--- a/libbb/skip_whitespace.c
+++ b/libbb/skip_whitespace.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/speed_table.c b/libbb/speed_table.c
index af676e1eb..6f95c54e6 100644
--- a/libbb/speed_table.c
+++ b/libbb/speed_table.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/str_tolower.c b/libbb/str_tolower.c
index f402e8e6f..c2d563798 100644
--- a/libbb/str_tolower.c
+++ b/libbb/str_tolower.c
@@ -1,7 +1,7 @@
1/* vi set: sw=4 ts=4: */ 1/* vi set: sw=4 ts=4: */
2/* Convert string str to lowercase, return str. 2/* Convert string str to lowercase, return str.
3 * 3 *
4 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 4 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
5 */ 5 */
6#include "libbb.h" 6#include "libbb.h"
7 7
diff --git a/libbb/strrstr.c b/libbb/strrstr.c
index d201f5172..d8823fc51 100644
--- a/libbb/strrstr.c
+++ b/libbb/strrstr.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2008 Bernhard Reutner-Fischer 5 * Copyright (C) 2008 Bernhard Reutner-Fischer
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#ifdef __DO_STRRSTR_TEST 10#ifdef __DO_STRRSTR_TEST
diff --git a/libbb/time.c b/libbb/time.c
index 8d176e52e..2a74d34c2 100644
--- a/libbb/time.c
+++ b/libbb/time.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2007 Denys Vlasenko 5 * Copyright (C) 2007 Denys Vlasenko
6 * 6 *
7 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/trim.c b/libbb/trim.c
index df00b846e..16cb4fbb0 100644
--- a/libbb/trim.c
+++ b/libbb/trim.c
@@ -5,7 +5,7 @@
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c
index 915eea579..9263859f5 100644
--- a/libbb/u_signal_names.c
+++ b/libbb/u_signal_names.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright 2006 Rob Landley <rob@landley.net> 5 * Copyright 2006 Rob Landley <rob@landley.net>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/udp_io.c b/libbb/udp_io.c
index 24237be99..b8fb6755d 100644
--- a/libbb/udp_io.c
+++ b/libbb/udp_io.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2007 Denys Vlasenko 5 * Copyright (C) 2007 Denys Vlasenko
6 * 6 *
7 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/unicode.c b/libbb/unicode.c
index d6fcf7a43..c4b5f86ee 100644
--- a/libbb/unicode.c
+++ b/libbb/unicode.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2009 Denys Vlasenko 5 * Copyright (C) 2009 Denys Vlasenko
6 * 6 *
7 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10#include "unicode.h" 10#include "unicode.h"
diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c
index f5ce1f955..a2be0f155 100644
--- a/libbb/update_passwd.c
+++ b/libbb/update_passwd.c
@@ -11,7 +11,7 @@
11 * Modified to be able to add or delete users, groups and users to/from groups 11 * Modified to be able to add or delete users, groups and users to/from groups
12 * by Tito Ragusa <farmatito@tiscali.it> 12 * by Tito Ragusa <farmatito@tiscali.it>
13 * 13 *
14 * Licensed under GPLv2, see file LICENSE in this tarball for details. 14 * Licensed under GPLv2, see file LICENSE in this source tree.
15 */ 15 */
16#include "libbb.h" 16#include "libbb.h"
17 17
@@ -133,7 +133,7 @@ int FAST_FUNC update_passwd(const char *filename,
133 goto close_old_fp; 133 goto close_old_fp;
134 134
135 created: 135 created:
136 if (!fstat(old_fd, &sb)) { 136 if (fstat(old_fd, &sb) == 0) {
137 fchmod(new_fd, sb.st_mode & 0777); /* ignore errors */ 137 fchmod(new_fd, sb.st_mode & 0777); /* ignore errors */
138 fchown(new_fd, sb.st_uid, sb.st_gid); 138 fchown(new_fd, sb.st_uid, sb.st_gid);
139 } 139 }
diff --git a/libbb/utmp.c b/libbb/utmp.c
index 68c358e9a..2bf9c11f2 100644
--- a/libbb/utmp.c
+++ b/libbb/utmp.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2010 Denys Vlasenko 5 * Copyright (C) 2010 Denys Vlasenko
6 * 6 *
7 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10#include <utmp.h> 10#include <utmp.h>
diff --git a/libbb/uuencode.c b/libbb/uuencode.c
index 67d98d598..181f49de0 100644
--- a/libbb/uuencode.c
+++ b/libbb/uuencode.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Copyright 2006 Rob Landley <rob@landley.net> 3 * Copyright 2006 Rob Landley <rob@landley.net>
4 * 4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 5 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 */ 6 */
7 7
8#include "libbb.h" 8#include "libbb.h"
diff --git a/libbb/vdprintf.c b/libbb/vdprintf.c
index 09fffbca8..feeb403a0 100644
--- a/libbb/vdprintf.c
+++ b/libbb/vdprintf.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index c5fbc380c..ee95be3e3 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10#if ENABLE_FEATURE_SYSLOG 10#if ENABLE_FEATURE_SYSLOG
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 2b6ee9e74..1fbb1bba9 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -12,7 +12,7 @@
12 * 12 *
13 * Modified for uClibc by Erik Andersen <andersee@debian.org> 13 * Modified for uClibc by Erik Andersen <andersee@debian.org>
14 * 14 *
15 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 15 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
16 */ 16 */
17 17
18#include "busybox.h" /* uses applet tables */ 18#include "busybox.h" /* uses applet tables */
diff --git a/libbb/warn_ignoring_args.c b/libbb/warn_ignoring_args.c
index fa33c258f..3f3025c03 100644
--- a/libbb/warn_ignoring_args.c
+++ b/libbb/warn_ignoring_args.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/wfopen.c b/libbb/wfopen.c
index deec79a28..76dc8b82a 100644
--- a/libbb/wfopen.c
+++ b/libbb/wfopen.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c
index 46ff7a6de..422a58ecf 100644
--- a/libbb/wfopen_input.c
+++ b/libbb/wfopen_input.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* A number of applets need to open a file for reading, where the filename 10/* A number of applets need to open a file for reading, where the filename
@@ -46,3 +46,11 @@ int FAST_FUNC open_or_warn_stdin(const char *filename)
46 46
47 return fd; 47 return fd;
48} 48}
49
50int FAST_FUNC xopen_stdin(const char *filename)
51{
52 int fd = open_or_warn_stdin(filename);
53 if (fd >= 0)
54 return fd;
55 xfunc_die(); /* We already output an error message. */
56}
diff --git a/libbb/write.c b/libbb/write.c
index 116e4d153..2d67a7281 100644
--- a/libbb/write.c
+++ b/libbb/write.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2008 Bernhard Reutner-Fischer 5 * Copyright (C) 2008 Bernhard Reutner-Fischer
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/xatonum.c b/libbb/xatonum.c
index 60b65f525..62bbe53e7 100644
--- a/libbb/xatonum.c
+++ b/libbb/xatonum.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c
index c97a4b795..f67b50710 100644
--- a/libbb/xatonum_template.c
+++ b/libbb/xatonum_template.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * Licensed under GPLv2, see file LICENSE in this tarball for details. 3 * Licensed under GPLv2, see file LICENSE in this source tree.
4 */ 4 */
5/* 5/*
6You need to define the following (example): 6You need to define the following (example):
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 2de6de7c5..3a6585caa 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Connect to host at port using address resolution from getaddrinfo 5 * Connect to host at port using address resolution from getaddrinfo
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include <sys/types.h> 10#include <sys/types.h>
diff --git a/libbb/xfunc_die.c b/libbb/xfunc_die.c
index ba9fe935a..204e5e49d 100644
--- a/libbb/xfunc_die.c
+++ b/libbb/xfunc_die.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com> 5 * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com>
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Keeping it separate allows to NOT suck in stdio for VERY small applets. 10/* Keeping it separate allows to NOT suck in stdio for VERY small applets.
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 275dd4b62..07504b75b 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -6,7 +6,7 @@
6 * Copyright (C) 2006 Rob Landley 6 * Copyright (C) 2006 Rob Landley
7 * Copyright (C) 2006 Denys Vlasenko 7 * Copyright (C) 2006 Denys Vlasenko
8 * 8 *
9 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11 11
12/* We need to have separate xfuncs.c and xfuncs_printf.c because 12/* We need to have separate xfuncs.c and xfuncs_printf.c because
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index 31a6d8e3c..ae950f94f 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -6,7 +6,7 @@
6 * Copyright (C) 2006 Rob Landley 6 * Copyright (C) 2006 Rob Landley
7 * Copyright (C) 2006 Denys Vlasenko 7 * Copyright (C) 2006 Denys Vlasenko
8 * 8 *
9 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11 11
12/* We need to have separate xfuncs.c and xfuncs_printf.c because 12/* We need to have separate xfuncs.c and xfuncs_printf.c because
@@ -450,6 +450,16 @@ void FAST_FUNC xstat(const char *name, struct stat *stat_buf)
450 bb_perror_msg_and_die("can't stat '%s'", name); 450 bb_perror_msg_and_die("can't stat '%s'", name);
451} 451}
452 452
453void FAST_FUNC xfstat(int fd, struct stat *stat_buf, const char *errmsg)
454{
455 /* errmsg is usually a file name, but not always:
456 * xfstat may be called in a spot where file name is no longer
457 * available, and caller may give e.g. "can't stat input file" string.
458 */
459 if (fstat(fd, stat_buf))
460 bb_simple_perror_msg_and_die(errmsg);
461}
462
453// selinux_or_die() - die if SELinux is disabled. 463// selinux_or_die() - die if SELinux is disabled.
454void FAST_FUNC selinux_or_die(void) 464void FAST_FUNC selinux_or_die(void)
455{ 465{
diff --git a/libbb/xgetcwd.c b/libbb/xgetcwd.c
index 10febe32d..97367217e 100644
--- a/libbb/xgetcwd.c
+++ b/libbb/xgetcwd.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * Special function for busybox written by Vladimir Oleynik <dzo@simtreas.ru> 7 * Special function for busybox written by Vladimir Oleynik <dzo@simtreas.ru>
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11 11
12#include "libbb.h" 12#include "libbb.h"
diff --git a/libbb/xgethostbyname.c b/libbb/xgethostbyname.c
index 7afa9b696..89d0329cc 100644
--- a/libbb/xgethostbyname.c
+++ b/libbb/xgethostbyname.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu>. 5 * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu>.
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9#include "libbb.h" 9#include "libbb.h"
10 10
diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c
index 1a012456f..f2faa6d7a 100644
--- a/libbb/xreadlink.c
+++ b/libbb/xreadlink.c
@@ -3,7 +3,7 @@
3 * xreadlink.c - safe implementation of readlink. 3 * xreadlink.c - safe implementation of readlink.
4 * Returns a NULL on failure... 4 * Returns a NULL on failure...
5 * 5 *
6 * Licensed under GPLv2, see file LICENSE in this tarball for details. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */ 7 */
8 8
9#include "libbb.h" 9#include "libbb.h"
diff --git a/libbb/xrealloc_vector.c b/libbb/xrealloc_vector.c
index 98fa9678e..e8d31b7e4 100644
--- a/libbb/xrealloc_vector.c
+++ b/libbb/xrealloc_vector.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2008 Denys Vlasenko 5 * Copyright (C) 2008 Denys Vlasenko
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
diff --git a/libbb/xregcomp.c b/libbb/xregcomp.c
index 61efb5bc6..344028f44 100644
--- a/libbb/xregcomp.c
+++ b/libbb/xregcomp.c
@@ -5,7 +5,7 @@
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11#include "libbb.h" 11#include "libbb.h"