Coding Syle Cleanups. Signed-Off-By: <michal.simek@petalogix.com>.
diff --git a/testcases/kernel/syscalls/setgid/setgid01.c b/testcases/kernel/syscalls/setgid/setgid01.c
index 889ca0e..a27e3f8 100644
--- a/testcases/kernel/syscalls/setgid/setgid01.c
+++ b/testcases/kernel/syscalls/setgid/setgid01.c
@@ -30,7 +30,7 @@
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*
*/
-/* $Id: setgid01.c,v 1.7 2009/02/26 12:16:35 subrata_modak Exp $ */
+/* $Id: setgid01.c,v 1.8 2009/03/23 13:36:02 subrata_modak Exp $ */
/**********************************************************
*
* OS Test - Silicon Graphics, Inc.
@@ -66,7 +66,7 @@
* (See the parse_opts(3) man page).
*
* OUTPUT SPECIFICATIONS
- *
+ *$
* DURATION
* Terminates - with frequency and infinite modes.
*
@@ -120,100 +120,97 @@
#include "compat_16.h"
-TCID_DEFINE(setgid01); /* Test program identifier. */
-int TST_TOTAL=1; /* Total number of test cases. */
+TCID_DEFINE(setgid01); /* Test program identifier. */
+int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
-int exp_enos[]={0, 0};
+int exp_enos[] = { 0, 0 };
GID_T gid;
-int
-main(int ac, char **av)
+int main(int ac, char **av)
{
- int lc; /* loop counter */
- char *msg; /* message returned from parse_opts */
-
+ int lc; /* loop counter */
+ char *msg; /* message returned from parse_opts */
+
/***************************************************************
* parse standard options
***************************************************************/
- if ( (msg=parse_opts(ac, av, (option_t *) NULL, NULL)) != (char *) NULL )
- tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+ if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL)) != (char *)NULL)
+ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
/***************************************************************
* perform global setup for test
***************************************************************/
- setup();
+ setup();
- /* set the expected errnos... */
- TEST_EXP_ENOS(exp_enos);
+ /* set the expected errnos... */
+ TEST_EXP_ENOS(exp_enos);
/***************************************************************
* check looping state if -c option given
***************************************************************/
- for (lc=0; TEST_LOOPING(lc); lc++) {
+ for (lc = 0; TEST_LOOPING(lc); lc++) {
- /* reset Tst_count in case we are looping. */
- Tst_count=0;
+ /* reset Tst_count in case we are looping. */
+ Tst_count = 0;
- /*
- * Call setgid(2)
- */
- TEST(SETGID(gid));
+ /*
+ * Call setgid(2)
+ */
+ TEST(SETGID(gid));
- /* check return code */
- if ( TEST_RETURN == -1 ) {
- TEST_ERROR_LOG(TEST_ERRNO);
- tst_resm(TFAIL, "setgid(%d) Failed, errno=%d : %s", gid,
- TEST_ERRNO, strerror(TEST_ERRNO));
- } else {
+ /* check return code */
+ if (TEST_RETURN == -1) {
+ TEST_ERROR_LOG(TEST_ERRNO);
+ tst_resm(TFAIL, "setgid(%d) Failed, errno=%d : %s", gid,
+ TEST_ERRNO, strerror(TEST_ERRNO));
+ } else {
/***************************************************************
* only perform functional verification if flag set (-f not given)
***************************************************************/
- if ( STD_FUNCTIONAL_TEST ) {
- /* No Verification test, yet... */
- tst_resm(TPASS, "setgid(%d) returned %d", gid, TEST_RETURN);
- }
- }
+ if (STD_FUNCTIONAL_TEST) {
+ /* No Verification test, yet... */
+ tst_resm(TPASS, "setgid(%d) returned %d", gid,
+ TEST_RETURN);
+ }
+ }
- } /* End for TEST_LOOPING */
-
+ } /* End for TEST_LOOPING */
+
/***************************************************************
* cleanup and exit
***************************************************************/
- cleanup();
+ cleanup();
- return 0;
-} /* End main */
+ return 0;
+} /* End main */
/***************************************************************
* setup() - performs all ONE TIME setup for this test.
***************************************************************/
-void
-setup()
+void setup()
{
- /* capture signals */
- tst_sig(NOFORK, DEF_HANDLER, cleanup);
+ /* capture signals */
+ tst_sig(NOFORK, DEF_HANDLER, cleanup);
- /* Pause if that option was specified */
- TEST_PAUSE;
-
- gid = GETGID();
-} /* End setup() */
+ /* Pause if that option was specified */
+ TEST_PAUSE;
+ gid = GETGID();
+} /* End setup() */
/***************************************************************
* cleanup() - performs all ONE TIME cleanup for this test at
* completion or premature exit.
***************************************************************/
-void
-cleanup()
+void cleanup()
{
- /*
- * print timing stats if that option was specified.
- * print errno log if that option was specified.
- */
- TEST_CLEANUP;
+ /*
+ * print timing stats if that option was specified.
+ * print errno log if that option was specified.
+ */
+ TEST_CLEANUP;
- /* exit with return code appropriate for results */
- tst_exit();
-} /* End cleanup() */
+ /* exit with return code appropriate for results */
+ tst_exit();
+} /* End cleanup() */