Whitespace cleanup

This commit is contained in:
Christian Barthel 2022-02-05 07:40:03 +01:00
parent 34c8e85e49
commit cfb359736f

38
xmem.c
View File

@ -136,20 +136,20 @@ int main(int argc, char **argv)
Arg args[1];
Pixmap icon_pixmap = None;
char *label, host[256];
/* For security reasons, we reset our uid/gid after doing the necessary
system initialization and before calling any X routines. */
if (setgid(getgid()) == -1)
if (setgid(getgid()) == -1)
errx(1, "%s: setgid failed: %s\n", argv[0], strerror(errno));
if (setuid(getuid()) == -1)
if (setuid(getuid()) == -1)
errx(1, "%s: setuid failed: %s\n", argv[0], strerror(errno));
toplevel = XtAppInitialize(&app_con, "XMem", options_mem, XtNumber(options_mem),
&argc, argv, NULL, NULL, (Cardinal) 0);
if (argc != 1) usage(argv[0]);
XtGetApplicationResources( toplevel, (XtPointer) &resources,
my_resources_mem, XtNumber(my_resources_mem),
NULL, (Cardinal) 0);
@ -160,7 +160,7 @@ int main(int argc, char **argv)
XtAppAddActions (app_con, xload_actions, XtNumber(xload_actions));
XtOverrideTranslations(toplevel,
XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
XtSetArg (args[0], XtNiconPixmap, &icon_pixmap);
XtGetValues(toplevel, args, ONE);
if (icon_pixmap == None) {
@ -171,33 +171,33 @@ int main(int argc, char **argv)
xload_width, xload_height));
XtSetValues (toplevel, args, ONE);
}
if (resources.show_label) {
pane = XtCreateManagedWidget ("paned", panedWidgetClass,
toplevel, NULL, ZERO);
label_wid = XtCreateManagedWidget ("label", labelWidgetClass,
pane, NULL, ZERO);
XtSetArg (args[0], XtNlabel, &label);
XtGetValues(label_wid, args, ONE);
if ( strcmp("label", label) == 0 ) {
(void) XmuGetHostname (host, 255);
XtSetArg (args[0], XtNlabel, host);
XtSetValues (label_wid, args, ONE);
}
load_parent = pane;
}
else
load_parent = toplevel;
load = XtCreateManagedWidget ("mem", memStripChartWidgetClass,
load_parent, NULL, ZERO);
XtAddCallback(load, XtNgetValue, (void*)GetMemLoadPoint, NULL);
XtRealizeWidget (toplevel);
wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
False);
@ -205,12 +205,12 @@ int main(int argc, char **argv)
&wm_delete_window, 1);
#if __OpenBSD__
if (pledge("ps vminfo stdio", NULL) == -1)
errx(1, "pledge failed: %s", strerror(errno));
if (pledge("ps vminfo stdio", NULL) == -1)
errx(1, "pledge failed: %s", strerror(errno));
#endif
XtAppMainLoop(app_con);
return 0;
return 0;
}