From 0ef64bdb40c54681e8dd5ab8df42ac88e4ab1d4a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 16 Aug 2010 20:14:46 +0200 Subject: *: make GNU licensing statement forms more regular This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko --- libbb/Kbuild.src | 2 +- libbb/appletlib.c | 4 ++-- libbb/ask_confirmation.c | 2 +- libbb/bb_askpass.c | 2 +- libbb/bb_basename.c | 2 +- libbb/bb_do_delay.c | 2 +- libbb/bb_pwd.c | 2 +- libbb/bb_qsort.c | 2 +- libbb/bb_strtod.c | 2 +- libbb/bb_strtonum.c | 2 +- libbb/chomp.c | 2 +- libbb/compare_string_array.c | 2 +- libbb/concat_path_file.c | 2 +- libbb/concat_subpath_file.c | 2 +- libbb/copy_file.c | 2 +- libbb/copyfd.c | 2 +- libbb/crc32.c | 2 +- libbb/create_icmp6_socket.c | 2 +- libbb/create_icmp_socket.c | 2 +- libbb/default_error_retval.c | 2 +- libbb/device_open.c | 2 +- libbb/die_if_bad_username.c | 2 +- libbb/dump.c | 2 +- libbb/execable.c | 2 +- libbb/fclose_nonstdin.c | 2 +- libbb/fflush_stdout_and_exit.c | 2 +- libbb/fgets_str.c | 2 +- libbb/find_mount_point.c | 2 +- libbb/find_pid_by_name.c | 2 +- libbb/find_root_device.c | 2 +- libbb/full_write.c | 2 +- libbb/get_console.c | 2 +- libbb/get_cpu_count.c | 2 +- libbb/get_last_path_component.c | 2 +- libbb/get_line_from_file.c | 2 +- libbb/get_volsize.c | 2 +- libbb/getopt32.c | 2 +- libbb/getpty.c | 2 +- libbb/herror_msg.c | 2 +- libbb/human_readable.c | 2 +- libbb/inet_common.c | 2 +- libbb/info_msg.c | 2 +- libbb/inode_hash.c | 2 +- libbb/isdirectory.c | 4 ++-- libbb/kernel_version.c | 2 +- libbb/last_char_is.c | 2 +- libbb/lineedit_ptr_hack.c | 2 +- libbb/llist.c | 2 +- libbb/login.c | 2 +- libbb/loop.c | 2 +- libbb/make_directory.c | 2 +- libbb/makedev.c | 2 +- libbb/match_fstype.c | 2 +- libbb/md5.c | 16 ++++++++-------- libbb/messages.c | 2 +- libbb/mode_string.c | 2 +- libbb/mtab.c | 2 +- libbb/mtab_file.c | 2 +- libbb/obscure.c | 2 +- libbb/parse_config.c | 2 +- libbb/parse_mode.c | 2 +- libbb/perror_msg.c | 2 +- libbb/perror_nomsg.c | 2 +- libbb/perror_nomsg_and_die.c | 2 +- libbb/pidfile.c | 2 +- libbb/platform.c | 2 +- libbb/print_flags.c | 2 +- libbb/printable.c | 2 +- libbb/printable_string.c | 2 +- libbb/process_escape_sequence.c | 2 +- libbb/procps.c | 2 +- libbb/ptr_to_globals.c | 2 +- libbb/pw_encrypt.c | 2 +- libbb/read.c | 2 +- libbb/read_key.c | 2 +- libbb/read_printf.c | 2 +- libbb/recursive_action.c | 2 +- libbb/remove_file.c | 2 +- libbb/rtc.c | 2 +- libbb/safe_gethostname.c | 2 +- libbb/safe_poll.c | 2 +- libbb/safe_strncpy.c | 2 +- libbb/safe_write.c | 2 +- libbb/selinux_common.c | 2 +- libbb/sha1.c | 2 +- libbb/signals.c | 2 +- libbb/simplify_path.c | 2 +- libbb/single_argv.c | 2 +- libbb/skip_whitespace.c | 2 +- libbb/speed_table.c | 2 +- libbb/str_tolower.c | 2 +- libbb/strrstr.c | 2 +- libbb/time.c | 2 +- libbb/trim.c | 2 +- libbb/u_signal_names.c | 2 +- libbb/udp_io.c | 2 +- libbb/unicode.c | 2 +- libbb/update_passwd.c | 2 +- libbb/utmp.c | 2 +- libbb/uuencode.c | 2 +- libbb/vdprintf.c | 2 +- libbb/verror_msg.c | 2 +- libbb/vfork_daemon_rexec.c | 2 +- libbb/warn_ignoring_args.c | 2 +- libbb/wfopen.c | 2 +- libbb/wfopen_input.c | 2 +- libbb/write.c | 2 +- libbb/xatonum.c | 2 +- libbb/xatonum_template.c | 2 +- libbb/xconnect.c | 2 +- libbb/xfunc_die.c | 2 +- libbb/xfuncs.c | 2 +- libbb/xfuncs_printf.c | 2 +- libbb/xgetcwd.c | 2 +- libbb/xgethostbyname.c | 2 +- libbb/xreadlink.c | 2 +- libbb/xrealloc_vector.c | 2 +- libbb/xregcomp.c | 2 +- 118 files changed, 127 insertions(+), 127 deletions(-) (limited to 'libbb') diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src index 6081ebe4b..5db4d8a62 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src @@ -2,7 +2,7 @@ # # Copyright (C) 1999-2005 by Erik Andersen # -# Licensed under the GPL v2, see the file LICENSE in this tarball. +# Licensed under GPLv2, see file LICENSE in this source tree. libbb/appletlib.o: include/usage_compressed.h diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 800c37448..8daa23309 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -7,9 +7,9 @@ * here, please feel free to acknowledge your work. * * Based in part on code from sash, Copyright (c) 1999 by David I. Bell - * Permission has been granted to redistribute this code under the GPL. + * Permission has been granted to redistribute this code under GPL. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/bb_basename.c b/libbb/bb_basename.c index bab4166d6..d678360fc 100644 --- a/libbb/bb_basename.c +++ b/libbb/bb_basename.c @@ -4,7 +4,7 @@ * * Copyright (C) 2007 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2005 by Tito Ragusa * - * Licensed under the GPL v2, see the file LICENSE in this tarball. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) 1999-2004 by Erik Andersen * Copyright (C) 2008 by Tito Ragusa * - * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (c) 2008 Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) many different people. * If you wrote this, please acknowledge your work. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ /* vi: set sw=4 ts=4: */ /* - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) many different people. * If you wrote this, please acknowledge your work. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) (C) 2003 Vladimir Oleynik * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* diff --git a/libbb/copy_file.c b/libbb/copy_file.c index ed765d8f0..57d9dbfdb 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c @@ -5,7 +5,7 @@ * Copyright (C) 2001 by Matt Kraai * SELinux support by Yuichi Nakamura * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 1999-2005 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * endian = 1: big-endian * endian = 0: little-endian * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * create raw socket for icmp (IPv6 version) protocol * and drop root privileges if running setuid * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * create raw socket for icmp protocol * and drop root privileges if running setuid * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ /* * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2008 Tito Ragusa * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/dump.c b/libbb/dump.c index 7a87219ba..a739ff61e 100644 --- a/libbb/dump.c +++ b/libbb/dump.c @@ -6,7 +6,7 @@ * Copyright (c) 1989 * The Regents of the University of California. All rights reserved. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. * * Original copyright notice is retained at the end of this file. */ diff --git a/libbb/execable.c b/libbb/execable.c index 82241cd81..d37640007 100644 --- a/libbb/execable.c +++ b/libbb/execable.c @@ -4,7 +4,7 @@ * * Copyright (C) 2006 Gabriel Somlo * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * Copyright (C) many different people. * If you wrote this, please acknowledge your work. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) many different people. If you wrote this, please * acknowledge your work. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2010 Marek Polacek * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2001 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) 2004 Erik Andersen * Copyright (C) 2001 Matt Krai * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2010 Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/getopt32.c b/libbb/getopt32.c index 8c87fe3f0..eb998009d 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c @@ -4,7 +4,7 @@ * * Copyright (C) 2003-2005 Vladimir Oleynik * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include 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 @@ * Mini getpty implementation for busybox * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * Some code to omit the decimal point and tenths digit is sketched out * and "#if 0"'d below. * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Heavily modified by Manuel Novoa III Mar 12, 2001 * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) many different people. * If you wrote this, please acknowledge your work. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * Utility routines. * * Based in part on code from sash, Copyright (c) 1999 by David I. Bell - * Permission has been granted to redistribute this code under the GPL. + * Permission has been granted to redistribute this code under GPL. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2001 Larry Doolittle, * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ /* * Copyright (C) 2008 by Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ struct 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 @@ * Copyright (C) 2005 Bernhard Reutner-Fischer * Copyright (C) 2006 Rob Landley * - * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Optimize and correcting OCRNL by Vladimir Oleynik * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) 1999-2004 by Erik Andersen * Copyright (C) 2005 by Rob Landley * - * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" #include diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 6dd04cf99..1350e8bd9 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c @@ -4,7 +4,7 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 2006 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ /* 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 @@ * * Returns 1 for a match, otherwise 0 * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ /* vi: set sw=4 ts=4: */ /* - * md5.c - Compute MD5 checksum of strings according to the - * definition of MD5 in RFC 1321 from April 1992. + * md5.c - Compute MD5 checksum of strings according to the + * definition of MD5 in RFC 1321 from April 1992. * - * Written by Ulrich Drepper , 1995. + * Written by Ulrich Drepper , 1995. * - * Copyright (C) 1995-1999 Free Software Foundation, Inc. - * Copyright (C) 2001 Manuel Novoa III - * Copyright (C) 2003 Glenn L. McGrath - * Copyright (C) 2003 Erik Andersen + * Copyright (C) 1995-1999 Free Software Foundation, Inc. + * Copyright (C) 2001 Manuel Novoa III + * Copyright (C) 2003 Glenn L. McGrath + * Copyright (C) 2003 Erik Andersen * - * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/messages.c b/libbb/messages.c index 1d0e58720..44b39942f 100644 --- a/libbb/messages.c +++ b/libbb/messages.c @@ -2,7 +2,7 @@ /* * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/obscure.c b/libbb/obscure.c index 19b87523e..22bcb9dec 100644 --- a/libbb/obscure.c +++ b/libbb/obscure.c @@ -4,7 +4,7 @@ * * Copyright (C) 2006 Tito Ragusa * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* A good password: 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 @@ * * Copyright (C) 2008 by Vladimir Dronnikov * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. * Also for use in uClibc (http://uclibc.org/) licensed under LGPLv2.1 or later. */ 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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 2007 by Stephane Billiart * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* Override ENABLE_FEATURE_PIDFILE */ diff --git a/libbb/platform.c b/libbb/platform.c index 7a8b17657..ccde2bf02 100644 --- a/libbb/platform.c +++ b/libbb/platform.c @@ -4,7 +4,7 @@ * * Copyright (C) 2009 by Dan Fandrich , et. al. * - * Licensed under the GPL version 2, see the file LICENSE in this tarball. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2008 Natanael Copa * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2007 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2010 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" #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 @@ * Copyright (C) Manuel Novoa III * and Vladimir Oleynik * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/procps.c b/libbb/procps.c index 48e60a792..16992b670 100644 --- a/libbb/procps.c +++ b/libbb/procps.c @@ -6,7 +6,7 @@ * Copyright (C) 2002 by Vladimir Oleynik * SELinux support: (c) 2007 by Yuichi Nakamura * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ /* * Copyright (C) 2008 by Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * Copyright (C) 2008 Rob Landley * Copyright (C) 2008 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2001 Matt Kraai * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ /* * Common RTC functions * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2008 Tito Ragusa * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* 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 @@ * * Copyright (C) 2007 by Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright 2007 KaiGai Kohei * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" #include 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 @@ * Copyright (C) 2003 Glenn L. McGrath * Copyright (C) 2003 Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. * * --------------------------------------------------------------------------- * 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 @@ * Copyright (C) 2006 Rob Landley * Copyright (C) 2006 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2001 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2009 Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ /* vi set: sw=4 ts=4: */ /* Convert string str to lowercase, return str. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2008 Bernhard Reutner-Fischer * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2007 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * Copyright (C) many different people. * If you wrote this, please acknowledge your work. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright 2006 Rob Landley * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2007 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2009 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" #include "unicode.h" diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c index f5ce1f955..e050dfc0e 100644 --- a/libbb/update_passwd.c +++ b/libbb/update_passwd.c @@ -11,7 +11,7 @@ * Modified to be able to add or delete users, groups and users to/from groups * by Tito Ragusa * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 2010 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include "libbb.h" #include 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 @@ /* * Copyright 2006 Rob Landley * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" #if ENABLE_FEATURE_SYSLOG diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index 5c2c529c9..5e0fb0d73 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c @@ -12,7 +12,7 @@ * * Modified for uClibc by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" 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 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c index 46ff7a6de..7263c933a 100644 --- a/libbb/wfopen_input.c +++ b/libbb/wfopen_input.c @@ -4,7 +4,7 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* A number of applets need to open a file for reading, where the filename 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 @@ * * Copyright (C) 2008 Bernhard Reutner-Fischer * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2003 Manuel Novoa III * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ /* * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ /* You 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 @@ * * Connect to host at port using address resolution from getaddrinfo * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #include 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 @@ * * Copyright (C) 2008 by Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ /* 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 @@ * Copyright (C) 2006 Rob Landley * Copyright (C) 2006 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ /* 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 91f7ba22c..b99f906df 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -6,7 +6,7 @@ * Copyright (C) 2006 Rob Landley * Copyright (C) 2006 Denys Vlasenko * - * Licensed under GPL version 2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ /* We need to have separate xfuncs.c and xfuncs_printf.c because 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 @@ * * Special function for busybox written by Vladimir Oleynik * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2001 Matt Kraai . * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c index faa0e1646..ec95af222 100644 --- a/libbb/xreadlink.c +++ b/libbb/xreadlink.c @@ -3,7 +3,7 @@ * xreadlink.c - safe implementation of readlink. * Returns a NULL on failure... * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * * Copyright (C) 2008 Denys Vlasenko * - * Licensed under GPLv2, see file LICENSE in this tarball for details. + * Licensed under GPLv2, see file LICENSE in this source tree. */ #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 @@ * Copyright (C) many different people. * If you wrote this, please acknowledge your work. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" -- cgit v1.2.3-55-g6feb From d71c770f05079e65b2d27d28ce22b0f08e71a207 Mon Sep 17 00:00:00 2001 From: Bob Dunlop Date: Tue, 17 Aug 2010 16:01:16 +0200 Subject: libbb: shrink obscure() function old new delta string_checker_helper 59 45 -14 string_checker 116 98 -18 obscure 367 204 -163 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-195) Total: -195 bytes Signed-off-by: Bob Dunlop Signed-off-by: Denys Vlasenko --- libbb/obscure.c | 78 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 33 deletions(-) (limited to 'libbb') diff --git a/libbb/obscure.c b/libbb/obscure.c index 22bcb9dec..06f00281a 100644 --- a/libbb/obscure.c +++ b/libbb/obscure.c @@ -45,53 +45,59 @@ static int string_checker_helper(const char *p1, const char *p2) __attribute__ ( static int string_checker_helper(const char *p1, const char *p2) { - /* as-is or capitalized */ - if (strcasecmp(p1, p2) == 0 /* as sub-string */ - || strcasestr(p2, p1) != NULL + if (strcasestr(p2, p1) != NULL /* invert in case haystack is shorter than needle */ - || strcasestr(p1, p2) != NULL) + || strcasestr(p1, p2) != NULL + /* as-is or capitalized */ + /* || strcasecmp(p1, p2) == 0 - 1st strcasestr should catch this too */ + ) { return 1; + } return 0; } static int string_checker(const char *p1, const char *p2) { - int size; + int size, i; /* check string */ int ret = string_checker_helper(p1, p2); - /* Make our own copy */ + /* make our own copy */ char *p = xstrdup(p1); - /* reverse string */ - size = strlen(p); - while (size--) { - *p = p1[size]; - p++; + /* reverse string */ + i = size = strlen(p1); + while (--i >= 0) { + *p++ = p1[i]; } - /* restore pointer */ - p -= strlen(p1); + p -= size; /* restore pointer */ + /* check reversed string */ ret |= string_checker_helper(p, p2); + /* clean up */ - memset(p, 0, strlen(p1)); + memset(p, 0, size); free(p); + return ret; } -#define LOWERCASE 1 -#define UPPERCASE 2 -#define NUMBERS 4 -#define SPECIAL 8 +#define CATEGORIES 4 + +#define LOWERCASE 1 +#define UPPERCASE 2 +#define NUMBERS 4 +#define SPECIAL 8 + +#define LAST_CAT 8 static const char *obscure_msg(const char *old_p, const char *new_p, const struct passwd *pw) { - int i; - int c; - int length; - int mixed = 0; - /* Add 2 for each type of characters to the minlen of password */ - int size = CONFIG_PASSWORD_MINLEN + 8; + unsigned length; + unsigned size; + unsigned mixed; + unsigned c; + unsigned i; const char *p; char *hostname; @@ -104,7 +110,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc return "similar to username"; } /* no gecos as-is, as sub-string, reversed, capitalized, doubled */ - if (*pw->pw_gecos && string_checker(new_p, pw->pw_gecos)) { + if (pw->pw_gecos[0] && string_checker(new_p, pw->pw_gecos)) { return "similar to gecos"; } /* 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 return "similar to hostname"; /* Should / Must contain a mix of: */ + mixed = 0; for (i = 0; i < length; i++) { if (islower(new_p[i])) { /* a-z */ mixed |= LOWERCASE; @@ -125,7 +132,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc } else { /* special characters */ mixed |= SPECIAL; } - /* More than 50% similar characters ? */ + /* Count i'th char */ c = 0; p = new_p; while (1) { @@ -134,26 +141,31 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc break; } c++; - if (!++p) { - break; /* move past the matched char if possible */ + p++; + if (!*p) { + break; } } - - if (c >= (length / 2)) { + /* More than 50% similar characters ? */ + if (c*2 >= length) { return "too many similar characters"; } } - for (i=0; i<4; i++) - if (mixed & (1< Date: Tue, 17 Aug 2010 17:21:36 +0200 Subject: libbb: fix fallout from last patch to obscure() (my mistake). +143 bytes Signed-off-by: Denys Vlasenko --- libbb/obscure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbb') diff --git a/libbb/obscure.c b/libbb/obscure.c index 06f00281a..dd8cd319a 100644 --- a/libbb/obscure.c +++ b/libbb/obscure.c @@ -153,7 +153,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc } size = CONFIG_PASSWORD_MINLEN + 2*CATEGORIES; - for (i = 0; i <= LAST_CAT; i <<= 1) + for (i = 1; i <= LAST_CAT; i <<= 1) if (mixed & i) size -= 2; if (length < size) -- cgit v1.2.3-55-g6feb From e7b0a9e5bc60617fb00c321430253d7771d40fd3 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 22 Aug 2010 05:39:15 +0200 Subject: patch: support "patch [FILE [PATCH]]" format function old new delta xopen_stdin - 15 +15 patch_main 2075 2041 -34 Signed-off-by: Denys Vlasenko --- editors/patch.c | 35 ++++++++++++++++++++++++----------- include/libbb.h | 1 + libbb/wfopen_input.c | 8 ++++++++ testsuite/patch.tests | 24 +++++++++++++++++++++++- 4 files changed, 56 insertions(+), 12 deletions(-) (limited to 'libbb') diff --git a/editors/patch.c b/editors/patch.c index 3ed4eba45..c40f54155 100644 --- a/editors/patch.c +++ b/editors/patch.c @@ -447,10 +447,21 @@ int patch_main(int argc UNUSED_PARAM, char **argv) INIT_TT(); opts = getopt32(argv, FLAG_STR, &opt_p, &opt_i); + argv += optind; reverse = opts & FLAG_REVERSE; TT.prefix = (opts & FLAG_PATHLEN) ? xatoi(opt_p) : 0; // can be negative! - if (opts & FLAG_INPUT) TT.filepatch = xopen(opt_i, O_RDONLY); TT.filein = TT.fileout = -1; + if (opts & FLAG_INPUT) { + TT.filepatch = xopen_stdin(opt_i); + } else { + if (argv[0] && argv[1]) { + TT.filepatch = xopen_stdin(argv[1]); + } + } + if (argv[0]) { + oldname = xstrdup(argv[0]); + newname = xstrdup(argv[0]); + } // Loop through the lines in the patch for(;;) { @@ -498,18 +509,20 @@ int patch_main(int argc UNUSED_PARAM, char **argv) state = 1; } - free(*name); finish_oldfile(); - // Trim date from end of filename (if any). We don't care. - for (s = patchline+4; *s && *s!='\t'; s++) - if (*s=='\\' && s[1]) s++; - i = atoi(s); - if (i>1900 && i<=1970) - *name = xstrdup("/dev/null"); - else { - *s = 0; - *name = xstrdup(patchline+4); + if (!argv[0]) { + free(*name); + // Trim date from end of filename (if any). We don't care. + for (s = patchline+4; *s && *s!='\t'; s++) + if (*s=='\\' && s[1]) s++; + i = atoi(s); + if (i>1900 && i<=1970) + *name = xstrdup("/dev/null"); + else { + *s = 0; + *name = xstrdup(patchline+4); + } } // We defer actually opening the file because svn produces broken diff --git a/include/libbb.h b/include/libbb.h index ac818a9ea..3fd754511 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -417,6 +417,7 @@ int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; int open_or_warn(const char *pathname, int flags) FAST_FUNC; int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; int open_or_warn_stdin(const char *pathname) FAST_FUNC; +int xopen_stdin(const char *pathname) FAST_FUNC; void xrename(const char *oldpath, const char *newpath) FAST_FUNC; int rename_or_warn(const char *oldpath, const char *newpath) FAST_FUNC; off_t xlseek(int fd, off_t offset, int whence) FAST_FUNC; diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c index 7263c933a..422a58ecf 100644 --- a/libbb/wfopen_input.c +++ b/libbb/wfopen_input.c @@ -46,3 +46,11 @@ int FAST_FUNC open_or_warn_stdin(const char *filename) return fd; } + +int FAST_FUNC xopen_stdin(const char *filename) +{ + int fd = open_or_warn_stdin(filename); + if (fd >= 0) + return fd; + xfunc_die(); /* We already output an error message. */ +} diff --git a/testsuite/patch.tests b/testsuite/patch.tests index cd0e965cf..e482304f6 100755 --- a/testsuite/patch.tests +++ b/testsuite/patch.tests @@ -129,7 +129,6 @@ abc " \ # testing "test name" "command(s)" "expected result" "file input" "stdin" - testing "patch -N ignores already applied hunk" \ 'patch -N 2>&1; echo $?; cat input' \ "\ @@ -153,6 +152,29 @@ def 123 " \ +# testing "test name" "command(s)" "expected result" "file input" "stdin" +testing "patch FILE PATCH" \ + 'cat >a.patch; patch input a.patch 2>&1; echo $?; cat input; rm a.patch' \ +"\ +patching file input +0 +abc +def +123 +" \ +"\ +abc +123 +" \ +"\ +--- foo.old ++++ foo +@@ -1,2 +1,3 @@ + abc ++def + 123 +" \ + rm input.orig 2>/dev/null exit $FAILCOUNT -- cgit v1.2.3-55-g6feb From 0834a6d3b9daec1f460c3cc836136ace12c53df0 Mon Sep 17 00:00:00 2001 From: Alexander Shishkin Date: Sat, 28 Aug 2010 23:20:34 +0200 Subject: pmap: new applet. +1k. pmap is a tool used to look at processes' memory maps, normally found in procps package. It provides more readable and easily sortable output (one line per mapping) from maps/smaps files in /proc/PID/. This would help in debugging memory usage issues, especially on devices where lots of typing is not a viable option. This patch does'n implement -d and -A command line options of GNU pmap, since those are not that must have features and I was afraid of going blind from looking at its code. The implementation takes smaps scanning part out of procps_scan() function and moves it into procps_read_smaps(), which does more detailed processing of a single PID's smaps data. Signed-off-by: Alexander Shishkin Signed-off-by: Denys Vlasenko --- include/libbb.h | 31 ++++++++--- libbb/procps.c | 160 ++++++++++++++++++++++++++++++++++++++------------------ procps/pmap.c | 111 +++++++++++++++++++++++++++++++++++++++ procps/top.c | 16 +++--- 4 files changed, 251 insertions(+), 67 deletions(-) create mode 100644 procps/pmap.c (limited to 'libbb') diff --git a/include/libbb.h b/include/libbb.h index 3fd754511..43e525cb9 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1387,6 +1387,29 @@ enum { COMM_LEN = TASK_COMM_LEN }; enum { COMM_LEN = 16 }; # endif #endif + +struct smaprec { + unsigned long mapped_rw; + unsigned long mapped_ro; + unsigned long shared_clean; + unsigned long shared_dirty; + unsigned long private_clean; + unsigned long private_dirty; + unsigned long stack; + unsigned long smap_pss, smap_swap; + unsigned long smap_size; + unsigned long smap_start; + char smap_mode[5]; + char *smap_name; +}; + +#if !ENABLE_PMAP +#define procps_read_smaps(pid, total, cb, data) \ + procps_read_smaps(pid, total) +#endif +int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, + void (*cb)(struct smaprec *, void *), void *data); + typedef struct procps_status_t { DIR *dir; IF_FEATURE_SHOW_THREADS(DIR *task_dir;) @@ -1415,13 +1438,7 @@ typedef struct procps_status_t { #endif unsigned tty_major,tty_minor; #if ENABLE_FEATURE_TOPMEM - unsigned long mapped_rw; - unsigned long mapped_ro; - unsigned long shared_clean; - unsigned long shared_dirty; - unsigned long private_clean; - unsigned long private_dirty; - unsigned long stack; + struct smaprec smaps; #endif char state[4]; /* basename of executable in exec(2), read from /proc/N/stat diff --git a/libbb/procps.c b/libbb/procps.c index 16992b670..14d4481bd 100644 --- a/libbb/procps.c +++ b/libbb/procps.c @@ -137,12 +137,9 @@ static unsigned long fast_strtoul_16(char **endptr) *endptr = str; /* We skip trailing space! */ return n; } -/* TOPMEM uses fast_strtoul_10, so... */ -# undef ENABLE_FEATURE_FAST_TOP -# define ENABLE_FEATURE_FAST_TOP 1 #endif -#if ENABLE_FEATURE_FAST_TOP +#if ENABLE_FEATURE_FAST_TOP || ENABLE_FEATURE_TOPMEM || ENABLE_PMAP /* We cut a lot of corners here for speed */ static unsigned long fast_strtoul_10(char **endptr) { @@ -177,6 +174,111 @@ static char *skip_fields(char *str, int count) } #endif +#if ENABLE_FEATURE_TOPMEM || ENABLE_PMAP +int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, + void (*cb)(struct smaprec *, void *), void *data) +{ + FILE *file; + struct smaprec currec; + char filename[sizeof("/proc/%u/smaps") + sizeof(int)*3]; + char buf[PROCPS_BUFSIZE]; +#if !ENABLE_PMAP + void (*cb)(struct smaprec *, void *) = NULL; + void *data = NULL; +#endif + + sprintf(filename, "/proc/%u/smaps", (int)pid); + + file = fopen_for_read(filename); + if (!file) + return 1; + + memset(&currec, 0, sizeof(currec)); + while (fgets(buf, PROCPS_BUFSIZE, file)) { + // Each mapping datum has this form: + // f7d29000-f7d39000 rw-s ADR M:m OFS FILE + // Size: nnn kB + // Rss: nnn kB + // ..... + + char *tp = buf, *p; + +#define SCAN(S, X) \ + if (strncmp(tp, S, sizeof(S)-1) == 0) { \ + tp = skip_whitespace(tp + sizeof(S)-1); \ + total->X += currec.X = fast_strtoul_10(&tp); \ + continue; \ + } + if (cb) { + SCAN("Pss:" , smap_pss ); + SCAN("Swap:" , smap_swap ); + } + SCAN("Private_Dirty:", private_dirty); + SCAN("Private_Clean:", private_clean); + SCAN("Shared_Dirty:" , shared_dirty ); + SCAN("Shared_Clean:" , shared_clean ); +#undef SCAN + tp = strchr(buf, '-'); + if (tp) { + // We reached next mapping - the line of this form: + // f7d29000-f7d39000 rw-s ADR M:m OFS FILE + + if (cb) { + /* If we have a previous record, there's nothing more + * for it, call the callback and clear currec + */ + if (currec.smap_size) + cb(&currec, data); + free(currec.smap_name); + } + memset(&currec, 0, sizeof(currec)); + + *tp = ' '; + tp = buf; + currec.smap_start = fast_strtoul_16(&tp); + currec.smap_size = (fast_strtoul_16(&tp) - currec.smap_start) >> 10; + + strncpy(currec.smap_mode, tp, sizeof(currec.smap_mode)-1); + + // skipping "rw-s ADR M:m OFS " + tp = skip_whitespace(skip_fields(tp, 4)); + // filter out /dev/something (something != zero) + if (strncmp(tp, "/dev/", 5) != 0 || strcmp(tp, "/dev/zero\n") == 0) { + if (currec.smap_mode[1] == 'w') { + currec.mapped_rw = currec.smap_size; + total->mapped_rw += currec.smap_size; + } else if (currec.smap_mode[1] == '-') { + currec.mapped_ro = currec.smap_size; + total->mapped_ro += currec.smap_size; + } + } + + if (strcmp(tp, "[stack]\n") == 0) + total->stack += currec.smap_size; + if (cb) { + p = skip_non_whitespace(tp); + if (p == tp) { + currec.smap_name = xstrdup(" [ anon ]"); + } else { + *p = '\0'; + currec.smap_name = xstrdup(tp); + } + } + total->smap_size += currec.smap_size; + } + } + fclose(file); + + if (cb) { + if (currec.smap_size) + cb(&currec, data); + free(currec.smap_name); + } + + return 0; +} +#endif + void BUG_comm_size(void); procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags) { @@ -365,54 +467,8 @@ procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags) } #if ENABLE_FEATURE_TOPMEM - if (flags & (PSSCAN_SMAPS)) { - FILE *file; - - strcpy(filename_tail, "smaps"); - file = fopen_for_read(filename); - if (file) { - while (fgets(buf, sizeof(buf), file)) { - unsigned long sz; - char *tp; - char w; -#define SCAN(str, name) \ - if (strncmp(buf, str, sizeof(str)-1) == 0) { \ - tp = skip_whitespace(buf + sizeof(str)-1); \ - sp->name += fast_strtoul_10(&tp); \ - continue; \ - } - SCAN("Shared_Clean:" , shared_clean ); - SCAN("Shared_Dirty:" , shared_dirty ); - SCAN("Private_Clean:", private_clean); - SCAN("Private_Dirty:", private_dirty); -#undef SCAN - // f7d29000-f7d39000 rw-s ADR M:m OFS FILE - tp = strchr(buf, '-'); - if (tp) { - *tp = ' '; - tp = buf; - sz = fast_strtoul_16(&tp); /* start */ - sz = (fast_strtoul_16(&tp) - sz) >> 10; /* end - start */ - // tp -> "rw-s" string - w = tp[1]; - // skipping "rw-s ADR M:m OFS " - tp = skip_whitespace(skip_fields(tp, 4)); - // filter out /dev/something (something != zero) - if (strncmp(tp, "/dev/", 5) != 0 || strcmp(tp, "/dev/zero\n") == 0) { - if (w == 'w') { - sp->mapped_rw += sz; - } else if (w == '-') { - sp->mapped_ro += sz; - } - } -//else printf("DROPPING %s (%s)\n", buf, tp); - if (strcmp(tp, "[stack]\n") == 0) - sp->stack += sz; - } - } - fclose(file); - } - } + if (flags & PSSCAN_SMAPS) + procps_read_smaps(pid, &sp->smaps, NULL, NULL); #endif /* TOPMEM */ #if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS if (flags & PSSCAN_RUIDGID) { diff --git a/procps/pmap.c b/procps/pmap.c new file mode 100644 index 000000000..cfa94ed82 --- /dev/null +++ b/procps/pmap.c @@ -0,0 +1,111 @@ +/* + * pmap implementation for busybox + * + * Copyright (C) 2010 Nokia Corporation. All rights reserved. + * Written by Alexander Shishkin + * + * Licensed under GPLv2 or later, see the LICENSE file in this source tree + * for details. + */ + +//applet:IF_PMAP(APPLET(pmap, _BB_DIR_USR_BIN, _BB_SUID_DROP)) +//kbuild:lib-$(CONFIG_PMAP) += pmap.o + +//config:config PMAP +//config: bool "pmap" +//config: default y +//config: help +//config: Display processes' memory mappings. + +//usage:#define pmap_trivial_usage +//usage: "[-x][-q] PID" +//usage:#define pmap_full_usage "\n\n" +//usage: "Display detailed precesses' memory usage\n" +//usage: "\nOptions:" +//usage: "\n -x show details" +//usage: "\n -q quiet" + +#include "libbb.h" + +#if ULONG_MAX == 0xffffffff +# define TABS "\t" +# define AFMT "8" +# define DASHES "" +#else +# define TABS "\t\t" +# define AFMT "16" +# define DASHES "--------" +#endif + +enum { + OPT_x = 1 << 0, + OPT_q = 1 << 1, +}; + +static void print_smaprec(struct smaprec *currec, void *data) +{ + unsigned opt = (unsigned)data; + + printf("%0" AFMT "lx ", currec->smap_start); + + if (opt & OPT_x) + printf("%7lu %7lu %7lu %7lu ", + currec->smap_size, + currec->smap_pss, + currec->private_dirty, + currec->smap_swap); + else + printf("%7luK", currec->smap_size); + + printf(" %.4s %s\n", currec->smap_mode, currec->smap_name); +} + +static int procps_get_maps(pid_t pid, unsigned opt) +{ + struct smaprec total; + int ret; + char buf[256]; + + read_cmdline(buf, sizeof(buf), pid, "no such process"); + printf("%u: %s\n", (int)pid, buf); + + if (!(opt & OPT_q) && (opt & OPT_x)) + puts("Address" TABS " Kbytes PSS Dirty Swap Mode Mapping"); + + memset(&total, 0, sizeof(total)); + + ret = procps_read_smaps(pid, &total, print_smaprec, (void*)opt); + if (ret) + return ret; + + if (!(opt & OPT_q)) { + if (opt & OPT_x) + printf("--------" DASHES " ------ ------ ------ ------\n" + "total" TABS " %7lu %7lu %7lu %7lu\n", + total.smap_size, total.smap_pss, total.private_dirty, total.smap_swap); + else + printf("mapped: %luK\n", total.smap_size); + } + + return 0; +} + +int pmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; +int pmap_main(int argc UNUSED_PARAM, char **argv) +{ + unsigned opts; + int ret; + + opts = getopt32(argv, "xq"); + argv += optind; + + ret = 0; + while (*argv) { + pid_t pid = xatoi_positive(*argv++); + /* GNU pmap returns 42 if any of the pids failed */ + if (procps_get_maps(pid, opts) != 0) + ret = 42; + } + + return ret; +} diff --git a/procps/top.c b/procps/top.c index fd758099e..4f37878de 100644 --- a/procps/top.c +++ b/procps/top.c @@ -942,20 +942,20 @@ int top_main(int argc UNUSED_PARAM, char **argv) } #if ENABLE_FEATURE_TOPMEM else { /* TOPMEM */ - if (!(p->mapped_ro | p->mapped_rw)) + if (!(p->smaps.mapped_ro | p->smaps.mapped_rw)) continue; /* kernel threads are ignored */ n = ntop; /* No bug here - top and topmem are the same */ top = xrealloc_vector(topmem, 6, ntop++); strcpy(topmem[n].comm, p->comm); topmem[n].pid = p->pid; - topmem[n].vsz = p->mapped_rw + p->mapped_ro; - topmem[n].vszrw = p->mapped_rw; - topmem[n].rss_sh = p->shared_clean + p->shared_dirty; - topmem[n].rss = p->private_clean + p->private_dirty + topmem[n].rss_sh; - topmem[n].dirty = p->private_dirty + p->shared_dirty; - topmem[n].dirty_sh = p->shared_dirty; - topmem[n].stack = p->stack; + topmem[n].vsz = p->smaps.mapped_rw + p->smaps.mapped_ro; + topmem[n].vszrw = p->smaps.mapped_rw; + topmem[n].rss_sh = p->smaps.shared_clean + p->smaps.shared_dirty; + topmem[n].rss = p->smaps.private_clean + p->smaps.private_dirty + topmem[n].rss_sh; + topmem[n].dirty = p->smaps.private_dirty + p->smaps.shared_dirty; + topmem[n].dirty_sh = p->smaps.shared_dirty; + topmem[n].stack = p->smaps.stack; } #endif } /* end of "while we read /proc" */ -- cgit v1.2.3-55-g6feb From 8d3e225a2d1d980bcedb825f294b6a8041fe3f1b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 31 Aug 2010 12:42:06 +0200 Subject: libbb: add xfstat function function old new delta xfstat - 25 +25 mkfs_ext2_main 2421 2423 +2 mkfs_reiser_main 1197 1194 -3 next 312 307 -5 ar_main 533 522 -11 mkfs_minix_main 2938 2924 -14 mkfs_vfat_main 1511 1495 -16 writeTarFile 272 255 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 27/-66) Total: -39 bytes Signed-off-by: Denys Vlasenko --- archival/ar.c | 3 +-- archival/tar.c | 3 +-- include/libbb.h | 1 + libbb/dump.c | 4 +--- libbb/update_passwd.c | 2 +- libbb/xfuncs_printf.c | 10 ++++++++++ miscutils/ubi_attach_detach.c | 4 ++-- shell/ash.c | 8 ++++++-- util-linux/mkfs_ext2.c | 2 +- util-linux/mkfs_minix.c | 3 +-- util-linux/mkfs_reiser.c | 4 ++-- util-linux/mkfs_vfat.c | 3 +-- util-linux/mkswap.c | 3 +-- 13 files changed, 29 insertions(+), 21 deletions(-) (limited to 'libbb') diff --git a/archival/ar.c b/archival/ar.c index bce62f76d..05556c6cb 100644 --- a/archival/ar.c +++ b/archival/ar.c @@ -123,8 +123,7 @@ static int write_ar_archive(archive_handle_t *handle) struct stat st; archive_handle_t *out_handle; - if (fstat(handle->src_fd, &st) == -1) - bb_simple_perror_msg_and_die(handle->ar__name); + xfstat(handle->src_fd, &st, handle->ar__name); /* if archive exists, create a new handle for output. * we create it in place of the old one. diff --git a/archival/tar.c b/archival/tar.c index b5cbf4197..2176ad2ac 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -572,8 +572,7 @@ static NOINLINE int writeTarFile(int tar_fd, int verboseFlag, /* Store the stat info for the tarball's file, so * can avoid including the tarball into itself.... */ - if (fstat(tbInfo.tarFd, &tbInfo.tarFileStatBuf) < 0) - bb_perror_msg_and_die("can't stat tar file"); + xfstat(tbInfo.tarFd, &tbInfo.tarFileStatBuf, "can't stat tar file"); #if ENABLE_FEATURE_SEAMLESS_GZ || ENABLE_FEATURE_SEAMLESS_BZ2 if (gzip) diff --git a/include/libbb.h b/include/libbb.h index 43e525cb9..6fb0438f5 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -411,6 +411,7 @@ void bb_unsetenv(const char *key) FAST_FUNC; void bb_unsetenv_and_free(char *key) FAST_FUNC; void xunlink(const char *pathname) FAST_FUNC; void xstat(const char *pathname, struct stat *buf) FAST_FUNC; +void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC; int xopen(const char *pathname, int flags) FAST_FUNC; int xopen_nonblocking(const char *pathname) FAST_FUNC; int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; diff --git a/libbb/dump.c b/libbb/dump.c index a739ff61e..4db3f06f0 100644 --- a/libbb/dump.c +++ b/libbb/dump.c @@ -323,9 +323,7 @@ static void do_skip(priv_dumper_t *dumper, const char *fname, int statok) struct stat sbuf; if (statok) { - if (fstat(STDIN_FILENO, &sbuf)) { - bb_simple_perror_msg_and_die(fname); - } + xfstat(STDIN_FILENO, &sbuf, fname); if (!(S_ISCHR(sbuf.st_mode) || S_ISBLK(sbuf.st_mode) || S_ISFIFO(sbuf.st_mode)) && dumper->pub.dump_skip >= sbuf.st_size ) { diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c index e050dfc0e..a2be0f155 100644 --- a/libbb/update_passwd.c +++ b/libbb/update_passwd.c @@ -133,7 +133,7 @@ int FAST_FUNC update_passwd(const char *filename, goto close_old_fp; created: - if (!fstat(old_fd, &sb)) { + if (fstat(old_fd, &sb) == 0) { fchmod(new_fd, sb.st_mode & 0777); /* ignore errors */ fchown(new_fd, sb.st_uid, sb.st_gid); } diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index b99f906df..c6db38d33 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -436,6 +436,16 @@ void FAST_FUNC xstat(const char *name, struct stat *stat_buf) bb_perror_msg_and_die("can't stat '%s'", name); } +void FAST_FUNC xfstat(int fd, struct stat *stat_buf, const char *errmsg) +{ + /* errmsg is usually a file name, but not always: + * xfstat may be called in a spot where file name is no longer + * available, and caller may give e.g. "can't stat input file" string. + */ + if (fstat(fd, stat_buf)) + bb_simple_perror_msg_and_die(errmsg); +} + // selinux_or_die() - die if SELinux is disabled. void FAST_FUNC selinux_or_die(void) { diff --git a/miscutils/ubi_attach_detach.c b/miscutils/ubi_attach_detach.c index 15377aa37..18ffd4df2 100644 --- a/miscutils/ubi_attach_detach.c +++ b/miscutils/ubi_attach_detach.c @@ -63,9 +63,9 @@ int ubi_attach_detach_main(int argc UNUSED_PARAM, char **argv) ubi_ctrl = argv[optind]; fd = xopen(ubi_ctrl, O_RDWR); - //fstat(fd, &st); + //xfstat(fd, &st, ubi_ctrl); //if (!S_ISCHR(st.st_mode)) - // bb_error_msg_and_die("'%s' is not a char device", ubi_ctrl); + // bb_error_msg_and_die("%s: not a char device", ubi_ctrl); if (do_attach) { if (!(opts & OPTION_M)) diff --git a/shell/ash.c b/shell/ash.c index 921367be5..28a8bb60c 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -4989,9 +4989,13 @@ noclobberopen(const char *fname) * revealed that it was a regular file, and the file has not been * replaced, return the file descriptor. */ - if (fstat(fd, &finfo2) == 0 && !S_ISREG(finfo2.st_mode) - && finfo.st_dev == finfo2.st_dev && finfo.st_ino == finfo2.st_ino) + if (fstat(fd, &finfo2) == 0 + && !S_ISREG(finfo2.st_mode) + && finfo.st_dev == finfo2.st_dev + && finfo.st_ino == finfo2.st_ino + ) { return fd; + } /* The file has been replaced. badness. */ close(fd); diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index 1c2b3b2e2..6dccd3a5d 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c @@ -221,7 +221,7 @@ int mkfs_ext2_main(int argc UNUSED_PARAM, char **argv) // open the device, check the device is a block device xmove_fd(xopen(argv[0], O_WRONLY), fd); - fstat(fd, &st); + xfstat(fd, &st, argv[0]); if (!S_ISBLK(st.st_mode) && !(option_mask32 & OPT_F)) bb_error_msg_and_die("%s: not a block device", argv[0]); diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 9e826aef3..95499ba17 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c @@ -686,8 +686,7 @@ int mkfs_minix_main(int argc UNUSED_PARAM, char **argv) bb_error_msg_and_die("can't format mounted filesystem"); xmove_fd(xopen(G.device_name, O_RDWR), dev_fd); - if (fstat(dev_fd, &statbuf) < 0) - bb_error_msg_and_die("can't stat '%s'", G.device_name); + xfstat(dev_fd, &statbuf, G.device_name); if (!S_ISBLK(statbuf.st_mode)) opt &= ~1; // clear -c (check) diff --git a/util-linux/mkfs_reiser.c b/util-linux/mkfs_reiser.c index 6e172d6d3..00ce8f1d1 100644 --- a/util-linux/mkfs_reiser.c +++ b/util-linux/mkfs_reiser.c @@ -168,9 +168,9 @@ int mkfs_reiser_main(int argc UNUSED_PARAM, char **argv) // check the device is a block device fd = xopen(argv[0], O_WRONLY | O_EXCL); - fstat(fd, &st); + xfstat(fd, &st, argv[0]); if (!S_ISBLK(st.st_mode) && !(option_mask32 & OPT_f)) - bb_error_msg_and_die("not a block device"); + bb_error_msg_and_die("%s: not a block device", argv[0]); // check if it is mounted // N.B. what if we format a file? find_mount_point will return false negative since diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c index 211e67e97..45760f7c5 100644 --- a/util-linux/mkfs_vfat.c +++ b/util-linux/mkfs_vfat.c @@ -245,8 +245,7 @@ int mkfs_vfat_main(int argc UNUSED_PARAM, char **argv) volume_id = time(NULL); dev = xopen(device_name, O_RDWR); - if (fstat(dev, &st) < 0) - bb_simple_perror_msg_and_die(device_name); + xfstat(dev, &st, device_name); // // Get image size and sector size diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index 61a786e92..53537fcd9 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c @@ -15,8 +15,7 @@ static void mkswap_selinux_setcontext(int fd, const char *path) if (!is_selinux_enabled()) return; - if (fstat(fd, &stbuf) < 0) - bb_perror_msg_and_die("fstat failed"); + xfstat(fd, &stbuf, argv[0]); if (S_ISREG(stbuf.st_mode)) { security_context_t newcon; security_context_t oldcon = NULL; -- cgit v1.2.3-55-g6feb