4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-18 23:12:15 +08:00

* pldd.c: Fix formatting.

This commit is contained in:
Yaakov Selkowitz 2012-02-24 10:38:20 +00:00
parent 10c8aafdb8
commit 769e28572c

View File

@ -34,10 +34,10 @@ static void
print_help (void) print_help (void)
{ {
printf ("Usage: pldd [OPTION...] PID\n\n" printf ("Usage: pldd [OPTION...] PID\n\n"
"List dynamic shared objects loaded into a process.\n\n" "List dynamic shared objects loaded into a process.\n\n"
" -?, --help Give this help list\n" " -?, --help Give this help list\n"
" --usage Give a short usage message\n" " --usage Give a short usage message\n"
" -V, --version Print program version\n"); " -V, --version Print program version\n");
exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
} }
@ -94,7 +94,7 @@ main (int argc, char *argv[])
print_version (); print_version ();
break; break;
case 0: case 0:
if (strcmp( "usage", longopts[optind].name ) == 0) if (strcmp ("usage", longopts[optind].name) == 0)
print_usage (); print_usage ();
break; break;
default: default:
@ -112,7 +112,7 @@ main (int argc, char *argv[])
error (1, 0, "invalid process ID '%s'", argv[0]); error (1, 0, "invalid process ID '%s'", argv[0]);
pidfile = (char *) malloc (32); pidfile = (char *) malloc (32);
sprintf(pidfile, "/proc/%d/winpid", pid); sprintf (pidfile, "/proc/%d/winpid", pid);
fd = fopen (pidfile, "rb"); fd = fopen (pidfile, "rb");
if (!fd) if (!fd)
error (1, ENOENT, "cannot open /proc/%d", pid); error (1, ENOENT, "cannot open /proc/%d", pid);
@ -120,7 +120,7 @@ main (int argc, char *argv[])
exefile = (char *) malloc (32); exefile = (char *) malloc (32);
exename = (char *) malloc (MAX_PATH); exename = (char *) malloc (MAX_PATH);
sprintf(exefile, "/proc/%d/exename", pid); sprintf (exefile, "/proc/%d/exename", pid);
fd = fopen (exefile, "rb"); fd = fopen (exefile, "rb");
fscanf (fd, "%s", exename); fscanf (fd, "%s", exename);
@ -130,9 +130,9 @@ main (int argc, char *argv[])
printf ("%d:\t%s\n", pid, exename); printf ("%d:\t%s\n", pid, exename);
EnumProcessModules (hProcess, hModules, sizeof(hModules), &cbModules); EnumProcessModules (hProcess, hModules, sizeof (hModules), &cbModules);
/* start at 1 to skip the executable itself */ /* start at 1 to skip the executable itself */
for (i = 1; i < (cbModules / sizeof(HMODULE)); i++) for (i = 1; i < (cbModules / sizeof (HMODULE)); i++)
{ {
TCHAR winname[MAX_PATH]; TCHAR winname[MAX_PATH];
char posixname[MAX_PATH]; char posixname[MAX_PATH];