miscellaneous: clean up trailing whitespace throughout

The entire tree's polluted with inappropriate trailing
whitespace. This commit rids our environment of all of
those useless keystrokes. Unfortunately, it sure ain't
a permanent solution and requires every contributor to
instruct their editor(s) to prevent or eliminate them.

Plus it's strongly recommended we all insert something
like what's shown below to our '.gitconfig' file so as
to provide at least some warnings when we try to apply
any patches (git am) that do contain the #@!%& things!

References(s):
~/.gitconfig excerpt ---------------------------------
[core]
  whitespace = trailing-space, space-before-tab, blank-at-eof
[apply]
  whitespace = warn
--------------------------------- ~/.gitconfig excerpt

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2013-03-11 00:00:00 -06:00 committed by Jaromir Capik
parent 7b708ca334
commit fe75e26ab6
23 changed files with 81 additions and 81 deletions

View File

@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an

View File

@ -9,7 +9,7 @@ buildroot git clone.
Once the apply merge is done you need to run 'make menuconfig',
choose Package Selection for the target --->, [*] Show packages that
are also provided by busybox && System tools ---> [*] procps-ng.
are also provided by busybox && System tools ---> [*] procps-ng.
If you do not want to configure anything else save, exit and make.
Notice that you almost certainly want to PROCPS_NG_VERSION
@ -80,6 +80,6 @@ index 0000000..0249b07
+
+$(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
--
--
1.7.10

View File

@ -441,7 +441,7 @@ char *argv[];
}
else
{
/*
/*
* Check out the next process
* If we can't open it, use info from this process,
* so we have to check out cmdline first.
@ -665,7 +665,7 @@ char *tty;
if (idle >= (60 * 60 * 48)) /* more than two days */
sprintf (give, "%2ludays", idle / (60 * 60 * 24));
else
sprintf (give, " %2lu:%02u", idle / (60 * 60),
sprintf (give, " %2lu:%02u", idle / (60 * 60),
(unsigned) ((idle / 60) % 60));
}
else

View File

@ -1,17 +1,17 @@
/*
* utmp.c - utmp printing command
* Copyright (C) Albert Cahalan
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@ -65,7 +65,7 @@ int main (int argc, char **argv) {
exit(1);
}
if (list) {
ut = fopen(UTMP_FILE, "r");
while (fread(&uts, sizeof(uts), 1, ut))
@ -90,7 +90,7 @@ int main (int argc, char **argv) {
if (fix) {
ut = fopen(UTMP_FILE, "r");
while (fread(&uts, sizeof(uts), 1, ut))
while (fread(&uts, sizeof(uts), 1, ut))
if (((uts.ut_type == USER_PROCESS) && (uts.ut_name[0] != '\000'))
|| print_all) {
/* Display entry in utmp */
@ -106,7 +106,7 @@ int main (int argc, char **argv) {
printf("ut_user: %s\n", user);
printf("ut_host: %s\n", host);
printf("ut_addr: %d\n\n", uts.ut_addr);
printf("Modify this record? (y/N): "); fflush(stdout);
/* Ask if to delete or no */
if ((ch = getchar()) == 'y' || ch == 'Y') {

2
free.1
View File

@ -90,7 +90,7 @@ memory information
.BR top "(1),
.BR vmstat (8).
.SH AUTHORS
Written by Brian Edmonds.
Written by Brian Edmonds.
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org

View File

@ -1,4 +1,4 @@
/*
/*
* This header was copied from util-linux at fall 2011.
*/

View File

@ -1,4 +1,4 @@
/*
/*
* This header was copied from util-linux at fall 2011.
*/

View File

@ -1,4 +1,4 @@
/*
/*
* This header was copied from util-linux at fall 2011.
*/

View File

@ -1,4 +1,4 @@
/*
/*
* strutils.c - various string routines shared by commands
* This file was copied from util-linux at fall 2011.
*

View File

@ -49,7 +49,7 @@ only.)
\fB\-c\fR, \fB\-\-count\fR
Suppress normal output; instead print a count of matching processes. When
count does not match anything, e.g. returns zero, the command will return
non-zero value.
non-zero value.
.TP
\fB\-d\fR, \fB\-\-delimiter\fR \fIdelimiter\fP
Sets the string used to delimit each process ID in the output (by default a
@ -116,8 +116,8 @@ Only match processes whose real user ID is listed. Either the numerical or
symbolical value may be used.
.TP
\fB\-v\fR, \fB\-\-inverse\fR\fR
Negates the matching. This option is usually used in
.BR pgrep 's
Negates the matching. This option is usually used in
.BR pgrep 's
context. In
.BR pkill 's
context the short option is disabled to avoid accidental usage of the option.

View File

@ -547,7 +547,7 @@ static struct el * select_procs (int *num)
xerrx(EXIT_FAILURE, _("internal error"));
}
}
memset (&task, 0, sizeof (task));
}
closeproc (ptp);
@ -622,7 +622,7 @@ static void parse_opts (int argc, char **argv)
/* These options are for pgrep only */
strcat (opts, "lad:v");
}
strcat (opts, "LF:cfnoxP:g:s:u:U:G:t:?Vh");
while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != -1) {
@ -810,7 +810,7 @@ int main (int argc, char **argv)
continue;
xwarn(_("killing pid %ld failed"), procs[i].num);
}
if (opt_count)
if (opt_count)
fprintf(stdout, "%d\n", num);
} else {
if (opt_count) {

View File

@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include <stdio.h>
#include <stdlib.h>

View File

@ -37,26 +37,26 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
int my_cells = 0;
int my_bytes = 0;
mbstate_t s;
memset(&s, 0, sizeof (s));
for(;;) {
wchar_t wc;
int len = 0;
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
break;
if (!(len = mbrtowc (&wc, src, MB_CUR_MAX, &s)))
/* 'str' contains \0 */
break;
if (len < 0) {
/* invalid multibyte sequence -- zeroize state */
memset (&s, 0, sizeof (s));
*(dst++) = '?';
src++;
my_cells++;
my_cells++;
my_bytes++;
} else if (!iswprint(wc)) {
@ -64,14 +64,14 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
*(dst++) = '?';
src+=len;
my_cells++;
my_bytes++;
my_bytes++;
} else {
/* multibyte - printable */
/* multibyte - printable */
int wlen = wcwidth(wc);
if (wlen==0) {
// invisible multibyte -- we don't ignore it, because some terminal
// invisible multibyte -- we don't ignore it, because some terminal
// interpret it wrong and more safe is replace it with '?'
*(dst++) = '?';
src+=len;
@ -103,7 +103,7 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
*dst = '\0';
// fprintf(stderr, "maxcells: %d, my_cells; %d\n", *maxcells, my_cells);
*maxcells -= my_cells;
return my_bytes; // bytes of text, excluding the NUL
}
@ -124,10 +124,10 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
"????????????????????????????????"
"????????????????????????????????"
"????????????????????????????????";
#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
static int utf_init=0;
if(utf_init==0){
/* first call -- check if UTF stuff is usable */
char *enc = nl_langinfo(CODESET);
@ -138,11 +138,11 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
return escape_str_utf8(dst, src, bufsize, maxcells);
}
#endif
if(bufsize > *maxcells+1) bufsize=*maxcells+1; // FIXME: assumes 8-bit locale
for(;;){
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
break;
c = (unsigned char) *(src++);
if(!c) break;
@ -152,7 +152,7 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
*(dst++) = c;
}
*dst = '\0';
*maxcells -= my_cells;
return my_bytes; // bytes of text, excluding the NUL
}

View File

@ -271,7 +271,7 @@ open_again:
continue;
}
if(done>0 && done<(ssize_t)room-total-1){
total += done;
total += done;
continue; /* OK, we read some. Go do more. */
}
fprintf(stderr,"%ld can't happen\n", (long)done);

View File

@ -1,4 +1,4 @@
/*
/*
* slab.c - slab related functions for libproc
*
* Chris Rivera <cmrivera@ufl.edu>
@ -62,7 +62,7 @@ static struct slab_info *get_slabnode(void)
/*
* slab_badname_detect - return true if current slab was declared with
* whitespaces for instance
* whitespaces for instance
* FIXME :Other cases ?
*/
@ -72,9 +72,9 @@ static int slab_badname_detect(const char *restrict buffer)
while (*buffer){
if((*buffer)==' ')
numberarea=1;
if(isalpha(*buffer)&&numberarea)
if(isalpha(*buffer)&&numberarea)
return 1;
buffer++;
buffer++;
}
return 0;
}
@ -101,7 +101,7 @@ void free_slabinfo(struct slab_info *list)
}
// parse_slabinfo20 - actual parse routine for slabinfo 2.x (2.6 kernels)
// Note: difference between 2.0 and 2.1 is in the ": globalstat" part where version 2.1
// Note: difference between 2.0 and 2.1 is in the ": globalstat" part where version 2.1
// has extra column <nodeallocs>. We don't use ": globalstat" part in both versions.
//
// Formats (we don't use "statistics" extensions)
@ -117,7 +117,7 @@ void free_slabinfo(struct slab_info *list)
// : slabdata <active_slabs> <num_slabs> <sharedavail> \
// : globalstat <listallocs> <maxobjs> <grown> <reaped> <error> <maxfreeable> <freelimit> <nodeallocs> \
// : cpustat <allochit> <allocmiss> <freehit> <freemiss>
//
//
// slabinfo - version: 2.0
// # name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
// : tunables <batchcount> <limit> <sharedfactor> \
@ -158,8 +158,8 @@ static int parse_slabinfo20(struct slab_info **list, struct slab_stat *stats,
assigned = sscanf(buffer, "%" STRINGIFY(SLAB_INFO_NAME_LEN)
"s %d %d %d %d %d : tunables %*d %*d %*d : \
slabdata %d %d %*d", curr->name,
&curr->nr_active_objs, &curr->nr_objs,
slabdata %d %d %*d", curr->name,
&curr->nr_active_objs, &curr->nr_objs,
&curr->obj_size, &curr->objs_per_slab,
&curr->pages_per_slab, &curr->nr_active_slabs,
&curr->nr_slabs);
@ -244,7 +244,7 @@ static int parse_slabinfo11(struct slab_info **list, struct slab_stat *stats,
if (assigned < 6) {
fprintf(stderr, "unrecognizable data in your slabinfo version 1.1\n\r");
if(slab_badname_detect(buffer))
fprintf(stderr, "Found an error in cache name at line %s\n", buffer);
fprintf(stderr, "Found an error in cache name at line %s\n", buffer);
curr = NULL;
break;
}
@ -264,7 +264,7 @@ static int parse_slabinfo11(struct slab_info **list, struct slab_stat *stats,
if (curr->obj_size)
curr->objs_per_slab = curr->pages_per_slab *
page_size / curr->obj_size;
page_size / curr->obj_size;
stats->nr_objs += curr->nr_objs;
stats->nr_active_objs += curr->nr_active_objs;

View File

@ -269,7 +269,7 @@ static void init_libproc(void){
cpuinfo();
#ifdef __linux__
if(linux_version_code > LINUX_VERSION(2, 4, 0)){
if(linux_version_code > LINUX_VERSION(2, 4, 0)){
Hertz = find_elf_note(AT_CLKTCK);
if(Hertz!=NOTE_NOT_FOUND) return;
fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr);
@ -360,7 +360,7 @@ void eight_cpu_numbers(double *restrict uret, double *restrict nret, double *res
void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) {
double avg_1=0, avg_5=0, avg_15=0;
char *savelocale;
FILE_TO_BUF(LOADAVG_FILE,loadavg_fd);
savelocale = strdup(setlocale(LC_NUMERIC, NULL));
setlocale(LC_NUMERIC, "C");
@ -447,7 +447,7 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
if(fd == -1) crash("/proc/stat");
}
read(fd,buff,BUFFSIZE-1);
*intr = 0;
*intr = 0;
*ciow = 0; /* not separated out until the 2.5.41 kernel */
*cxxx = 0; /* not separated out until the 2.6.0-test4 kernel */
*cyyy = 0; /* not separated out until the 2.6.0-test4 kernel */
@ -719,21 +719,21 @@ unsigned long vm_pageoutrun; // times kswapd ran page reclaim
unsigned long vm_allocstall; // times a page allocator ran direct reclaim
unsigned long vm_pgrotated; // pages rotated to the tail of the LRU for immediate reclaim
// seen on a 2.6.8-rc1 kernel, apparently replacing old fields
static unsigned long vm_pgalloc_dma; //
static unsigned long vm_pgalloc_high; //
static unsigned long vm_pgalloc_normal; //
static unsigned long vm_pgrefill_dma; //
static unsigned long vm_pgrefill_high; //
static unsigned long vm_pgrefill_normal; //
static unsigned long vm_pgscan_direct_dma; //
static unsigned long vm_pgscan_direct_high; //
static unsigned long vm_pgscan_direct_normal; //
static unsigned long vm_pgscan_kswapd_dma; //
static unsigned long vm_pgscan_kswapd_high; //
static unsigned long vm_pgscan_kswapd_normal; //
static unsigned long vm_pgsteal_dma; //
static unsigned long vm_pgsteal_high; //
static unsigned long vm_pgsteal_normal; //
static unsigned long vm_pgalloc_dma; //
static unsigned long vm_pgalloc_high; //
static unsigned long vm_pgalloc_normal; //
static unsigned long vm_pgrefill_dma; //
static unsigned long vm_pgrefill_high; //
static unsigned long vm_pgrefill_normal; //
static unsigned long vm_pgscan_direct_dma; //
static unsigned long vm_pgscan_direct_high; //
static unsigned long vm_pgscan_direct_normal; //
static unsigned long vm_pgscan_kswapd_dma; //
static unsigned long vm_pgscan_kswapd_high; //
static unsigned long vm_pgscan_kswapd_normal; //
static unsigned long vm_pgsteal_dma; //
static unsigned long vm_pgsteal_high; //
static unsigned long vm_pgsteal_normal; //
// seen on a 2.6.8-rc1 kernel
static unsigned long vm_kswapd_inodesteal; //
static unsigned long vm_nr_unstable; //
@ -887,7 +887,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
*disks = NULL;
*partitions = NULL;
buff[BUFFSIZE-1] = 0;
buff[BUFFSIZE-1] = 0;
fd = fopen("/proc/diskstats", "rb");
if(!fd) crash("/proc/diskstats");
@ -932,7 +932,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
&(*partitions)[cPartition].requested_writes
);
(*partitions)[cPartition++].parent_disk = cDisk-1;
(*disks)[cDisk-1].partitions++;
(*disks)[cDisk-1].partitions++;
}
}
@ -945,7 +945,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
unsigned int getslabinfo (struct slab_cache **slab){
FILE* fd;
int cSlab = 0;
buff[BUFFSIZE-1] = 0;
buff[BUFFSIZE-1] = 0;
*slab = NULL;
fd = fopen("/proc/slabinfo", "rb");
if(!fd) crash("/proc/slabinfo");

View File

@ -45,7 +45,7 @@ void init_Linux_version(void) {
#ifdef __linux__
static struct utsname uts;
if (uname(&uts) == -1) /* failure implies impending death */
exit(1);

View File

@ -804,13 +804,13 @@ if the parent process exits.
If the length of the username is greater than the length of the display
column, the numeric user ID is displayed instead.
.PP
Commands options such as
Commands options such as
.B ps \-aux
are not recommended as it is a confusion of two different standards.
According to the POSIX and UNIX standards, the above command asks to
display all processes with a TTY (generally the commands users are
running) plus all processes owned by a user named "x". If that user
doesn't exist, then
doesn't exist, then
.B ps
will assume you really meant "\fBps\fR \fIaux\fR".
.SH "PROCESS FLAGS"

View File

@ -14,7 +14,7 @@ displays detailed kernel slab cache information in real time. It displays a
listing of the top caches sorted by one of the listed sort criteria. It also
displays a statistics header filled with slab layer information.
.SH OPTIONS
Normal invocation of
Normal invocation of
.B slabtop
does not require any options. The behavior, however, can be fine-tuned by
specifying one or more of the following flags:

View File

@ -18,7 +18,7 @@ sysctl \- configure kernel parameters at runtime
.SH DESCRIPTION
.B sysctl
is used to modify kernel parameters at runtime. The parameters available
are those listed under /proc/sys/. Procfs is required for
are those listed under /proc/sys/. Procfs is required for
.B sysctl
support in Linux. You can use
.B sysctl

View File

@ -50,4 +50,4 @@ EXTRA_DIST = \
sysctl.test/sysctl_read.exp \
uptime.test/uptime.exp \
vmstat.test/vmstat.exp \
w.test/w.exp
w.test/w.exp

4
w.c
View File

@ -142,12 +142,12 @@ static void print_display_or_interface(const char *restrict host, int len, int r
fputc('-', stdout);
}
} else { /* multiple colons found - it's an IPv6 address */
/* search for % (interface separator in case of IPv6 link address) */
while ( (tmp < (host + len)) && (*tmp != '%') && isprint(*tmp) ) tmp++;
if (*tmp == '%') { /* interface separator found */
/* number of chars till the end of the input field */
len -= (tmp - host);