You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2019/06/19 10:21:50 UTC

[commons-daemon] branch master updated (1ba951f -> 60d1a6a)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git.


    from 1ba951f  Add ALv2 header
     new a9bee1b  Update format to better align with current code style
     new 1f99ce9  Run indent (with a few manual tweaks afterwards)
     new 60d1a6a  Format tweak

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/native/unix/native/.indent.pro |   4 +-
 src/native/unix/native/arguments.c | 103 ++++++++++-----------
 src/native/unix/native/debug.c     |   5 +-
 src/native/unix/native/dso-dlfcn.c |   1 -
 src/native/unix/native/dso-dyld.c  |   9 +-
 src/native/unix/native/help.c      |   4 +-
 src/native/unix/native/home.c      |   4 +-
 src/native/unix/native/java.c      |  76 +++++++---------
 src/native/unix/native/jsvc-unix.c | 181 +++++++++++++++++--------------------
 src/native/unix/native/location.c  |  47 +++++-----
 src/native/unix/native/locks.c     |   7 +-
 src/native/unix/native/replace.c   |   3 +-
 src/native/unix/native/signals.c   |   9 +-
 13 files changed, 210 insertions(+), 243 deletions(-)


[commons-daemon] 02/03: Run indent (with a few manual tweaks afterwards)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git

commit 1f99ce9e87e2c5711b22183d6256839e5f9beb51
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 19 11:15:35 2019 +0100

    Run indent (with a few manual tweaks afterwards)
---
 src/native/unix/native/arguments.c | 103 ++++++++++-----------
 src/native/unix/native/debug.c     |   5 +-
 src/native/unix/native/dso-dlfcn.c |   1 -
 src/native/unix/native/dso-dyld.c  |   9 +-
 src/native/unix/native/help.c      |   4 +-
 src/native/unix/native/home.c      |   4 +-
 src/native/unix/native/java.c      |  76 +++++++---------
 src/native/unix/native/jsvc-unix.c | 181 +++++++++++++++++--------------------
 src/native/unix/native/location.c  |  47 +++++-----
 src/native/unix/native/locks.c     |   7 +-
 src/native/unix/native/replace.c   |   3 +-
 src/native/unix/native/signals.c   |   9 +-
 12 files changed, 208 insertions(+), 241 deletions(-)

diff --git a/src/native/unix/native/arguments.c b/src/native/unix/native/arguments.c
index 924b73a..8160c72 100644
--- a/src/native/unix/native/arguments.c
+++ b/src/native/unix/native/arguments.c
@@ -35,7 +35,7 @@ static char *optional(int argc, char *argv[], int argi)
 static char *memstrcat(char *ptr, const char *str, const char *add)
 {
     size_t nl = 1;
-    int   nas = ptr == NULL;
+    int nas = ptr == NULL;
     if (ptr)
         nl += strlen(ptr);
     if (str)
@@ -54,10 +54,10 @@ static char *memstrcat(char *ptr, const char *str, const char *add)
     return ptr;
 }
 
-static char* eval_ppath(char *strcp, const char *pattern)
+static char *eval_ppath(char *strcp, const char *pattern)
 {
     glob_t globbuf;
-    char   jars[PATH_MAX + 1];
+    char jars[PATH_MAX + 1];
 
     if (strlen(pattern) > (sizeof(jars) - 5)) {
         return memstrcat(strcp, pattern, NULL);
@@ -86,7 +86,7 @@ static char* eval_ppath(char *strcp, const char *pattern)
  * Glob is called only if the part ends with asterisk in which
  * case asterisk is replaced by *.jar when searching
  */
-static char* eval_cpath(const char *cp)
+static char *eval_cpath(const char *cp)
 {
     char *cpy = memstrcat(NULL, JAVA_CLASSPATH, cp);
     char *gcp = NULL;
@@ -105,8 +105,8 @@ static char* eval_cpath(const char *cp)
         if ((pos > ptr) && (*(pos - 1) == '*')) {
             if (!(gcp = eval_ppath(gcp, ptr))) {
                 /* Error.
-                * Return the original string processed so far.
-                */
+                 * Return the original string processed so far.
+                 */
                 return cpy;
             }
         }
@@ -122,8 +122,8 @@ static char* eval_cpath(const char *cp)
             gcp = memstrcat(NULL, JAVA_CLASSPATH, NULL);
         if (end > 0 && ptr[end - 1] == '*') {
             /* Last path elemet ends with star
-            * Do a globbing.
-            */
+             * Do a globbing.
+             */
             gcp = eval_ppath(gcp, ptr);
         }
         else {
@@ -144,38 +144,38 @@ static char* eval_cpath(const char *cp)
 static arg_data *parse(int argc, char *argv[])
 {
     arg_data *args = NULL;
-    char *temp     = NULL;
-    char *cmnd     = NULL;
-    int x          = 0;
+    char *temp = NULL;
+    char *cmnd = NULL;
+    int x = 0;
 
     /* Create the default command line arguments */
     args = (arg_data *)malloc(sizeof(arg_data));
-    args->pidf = "/var/run/jsvc.pid"; /* The default PID file */
-    args->user    = NULL;         /* No user switching by default */
-    args->dtch    = true;         /* Do detach from parent */
-    args->vers    = false;        /* Don't display version */
-    args->help    = false;        /* Don't display help */
-    args->chck    = false;        /* Don't do a check-only startup */
-    args->stop    = false;        /* Stop a running jsvc */
-    args->wait    = 0;            /* Wait until jsvc has started the JVM */
-    args->restarts = -1;          /* Infinite restarts by default */
-    args->install = false;        /* Don't install as a service */
-    args->remove  = false;        /* Don't remove the installed service */
-    args->service = false;        /* Don't run as a service */
-    args->name    = NULL;         /* No VM version name */
-    args->home    = NULL;         /* No default JAVA_HOME */
-    args->onum    = 0;            /* Zero arguments, but let's have some room */
-    args->clas    = NULL;         /* No class predefined */
-    args->anum    = 0;            /* Zero class specific arguments but make room*/
-    args->cwd     = "/";           /* Use root as default */
-    args->outfile = "/dev/null";   /* Swallow by default */
-    args->errfile = "/dev/null";   /* Swallow by default */
-    args->redirectstdin = true;    /* Redirect stdin to /dev/null by default */
+    args->pidf = "/var/run/jsvc.pid";  /* The default PID file */
+    args->user = NULL;                 /* No user switching by default */
+    args->dtch = true;                 /* Do detach from parent */
+    args->vers = false;                /* Don't display version */
+    args->help = false;                /* Don't display help */
+    args->chck = false;                /* Don't do a check-only startup */
+    args->stop = false;                /* Stop a running jsvc */
+    args->wait = 0;                    /* Wait until jsvc has started the JVM */
+    args->restarts = -1;               /* Infinite restarts by default */
+    args->install = false;             /* Don't install as a service */
+    args->remove = false;              /* Don't remove the installed service */
+    args->service = false;             /* Don't run as a service */
+    args->name = NULL;                 /* No VM version name */
+    args->home = NULL;                 /* No default JAVA_HOME */
+    args->onum = 0;                    /* Zero arguments, but let's have some room */
+    args->clas = NULL;                 /* No class predefined */
+    args->anum = 0;                    /* Zero class specific arguments but make room */
+    args->cwd = "/";                   /* Use root as default */
+    args->outfile = "/dev/null";       /* Swallow by default */
+    args->errfile = "/dev/null";       /* Swallow by default */
+    args->redirectstdin = true;        /* Redirect stdin to /dev/null by default */
     args->procname = "jsvc.exec";
 #ifndef JSVC_UMASK
-    args->umask   = 0077;
+    args->umask = 0077;
 #else
-    args->umask   = JSVC_UMASK;
+    args->umask = JSVC_UMASK;
 #endif
 
     if (!(args->args = (char **)malloc(argc * sizeof(char *))))
@@ -184,7 +184,7 @@ static arg_data *parse(int argc, char *argv[])
         return NULL;
 
     /* Set up the command name */
-    cmnd = strrchr(argv[0],'/');
+    cmnd = strrchr(argv[0], '/');
     if (cmnd == NULL)
         cmnd = argv[0];
     else
@@ -194,8 +194,7 @@ static arg_data *parse(int argc, char *argv[])
     /* Iterate thru command line arguments */
     for (x = 1; x < argc; x++) {
 
-        if (!strcmp(argv[x], "-cp") ||
-            !strcmp(argv[x], "-classpath")) {
+        if (!strcmp(argv[x], "-cp") || !strcmp(argv[x], "-classpath")) {
             temp = optional(argc, argv, x++);
             if (temp == NULL) {
                 log_error("Invalid classpath specified");
@@ -223,8 +222,7 @@ static arg_data *parse(int argc, char *argv[])
         else if (!strcmp(argv[x], "-server")) {
             args->name = strdup("server");
         }
-        else if (!strcmp(argv[x], "-home") ||
-                 !strcmp(argv[x], "-java-home")) {
+        else if (!strcmp(argv[x], "-home") || !strcmp(argv[x], "-java-home")) {
             args->home = optional(argc, argv, x++);
             if (args->home == NULL) {
                 log_error("Invalid Java Home specified");
@@ -252,9 +250,7 @@ static arg_data *parse(int argc, char *argv[])
         else if (!strcmp(argv[x], "-showversion")) {
             args->vershow = true;
         }
-        else if (!strcmp(argv[x], "-?") ||
-                 !strcmp(argv[x], "-help") ||
-                 !strcmp(argv[x], "--help")) {
+        else if (!strcmp(argv[x], "-?") || !strcmp(argv[x], "-help") || !strcmp(argv[x], "--help")) {
             args->help = true;
             args->dtch = false;
             return args;
@@ -308,7 +304,7 @@ static arg_data *parse(int argc, char *argv[])
             args->dtch = false;
         }
         else if (!strcmp(argv[x], "-keepstdin")) {
-           args->redirectstdin = false;
+            args->redirectstdin = false;
         }
         else if (!strcmp(argv[x], "-service")) {
             args->service = true;
@@ -328,7 +324,7 @@ static arg_data *parse(int argc, char *argv[])
         }
         else if (!strcmp(argv[x], "-outfile")) {
             args->outfile = optional(argc, argv, x++);
-            if(args->outfile == NULL) {
+            if (args->outfile == NULL) {
                 log_error("Invalid Output File specified");
                 return NULL;
             }
@@ -385,8 +381,8 @@ static arg_data *parse(int argc, char *argv[])
         else if (!strcmp(argv[x], "-procname")) {
             args->procname = optional(argc, argv, x++);
             if (args->procname == NULL) {
-              log_error("Invalid process name specified");
-              return NULL;
+                log_error("Invalid process name specified");
+                return NULL;
             }
         }
         else if (!strncmp(argv[x], "-agentlib:", 10)) {
@@ -398,7 +394,7 @@ static arg_data *parse(int argc, char *argv[])
         else if (!strncmp(argv[x], "-javaagent:", 11)) {
             args->opts[args->onum++] = strdup(argv[x]);
         }
-	/* Java 9 specific options */
+        /* Java 9 specific options */
         else if (!strncmp(argv[x], "--add-modules=", 14)) {
             args->opts[args->onum++] = strdup(argv[x]);
         }
@@ -427,11 +423,11 @@ static arg_data *parse(int argc, char *argv[])
             args->opts[args->onum++] = strdup(argv[x]);
         }
         else if (*argv[x] == '-') {
-            log_error("Invalid option %s",argv[x]);
+            log_error("Invalid option %s", argv[x]);
             return NULL;
         }
         else {
-            args->clas=strdup(argv[x]);
+            args->clas = strdup(argv[x]);
             break;
         }
     }
@@ -447,6 +443,7 @@ static arg_data *parse(int argc, char *argv[])
     }
     return args;
 }
+
 static const char *IsYesNo(bool par)
 {
     switch (par) {
@@ -457,13 +454,14 @@ static const char *IsYesNo(bool par)
     }
     return "[Error]";
 }
+
 static const char *IsTrueFalse(bool par)
 {
     switch (par) {
         case false:
             return "False";
         case true:
-             return "True";
+            return "True";
     }
     return "[Error]";
 }
@@ -482,7 +480,7 @@ static const char *IsEnabledDisabled(bool par)
 /* Main entry point: parse command line arguments and dump them */
 arg_data *arguments(int argc, char *argv[])
 {
-    arg_data *args = parse(argc,argv);
+    arg_data *args = parse(argc, argv);
     int x = 0;
 
     if (args == NULL) {
@@ -515,10 +513,9 @@ arg_data *arguments(int argc, char *argv[])
         log_debug("| Class Invoked:   \"%s\"", PRINT_NULL(args->clas));
         log_debug("| Class Arguments: %d", args->anum);
         for (x = 0; x < args->anum; x++) {
-            log_debug("|   \"%s\"",args->args[x]);
+            log_debug("|   \"%s\"", args->args[x]);
         }
         log_debug("+-------------------------------------------------------");
     }
     return args;
 }
-
diff --git a/src/native/unix/native/debug.c b/src/native/unix/native/debug.c
index f802419..b00d32f 100644
--- a/src/native/unix/native/debug.c
+++ b/src/native/unix/native/debug.c
@@ -44,7 +44,7 @@ void log_debug(const char *fmt, ...)
     if (fmt == NULL)
         return;
 
-    now   = time(NULL);
+    now = time(NULL);
     nowtm = localtime(&now);
     strftime(buff, sizeof(buff), "%Y-%m-%d %T", nowtm);
     va_start(ap, fmt);
@@ -73,7 +73,7 @@ void log_error(const char *fmt, ...)
 
     va_start(ap, fmt);
     if (log_stderr_syslog_flag) {
-        now   = time(NULL);
+        now = time(NULL);
         nowtm = localtime(&now);
         strftime(buff, sizeof(buff), "%Y-%m-%d %T", nowtm);
         fprintf(stderr, "%s %d %s error: ", buff, getpid(), log_prog);
@@ -83,4 +83,3 @@ void log_error(const char *fmt, ...)
     fflush(stderr);
     va_end(ap);
 }
-
diff --git a/src/native/unix/native/dso-dlfcn.c b/src/native/unix/native/dso-dlfcn.c
index b3ee533..5ee58ae 100644
--- a/src/native/unix/native/dso-dlfcn.c
+++ b/src/native/unix/native/dso-dlfcn.c
@@ -58,4 +58,3 @@ char *dso_error(void)
 }
 
 #endif /* ifdef DSO_DLFCN */
-
diff --git a/src/native/unix/native/dso-dyld.c b/src/native/unix/native/dso-dyld.c
index 2ba7c0e..3b3a3bd 100644
--- a/src/native/unix/native/dso-dyld.c
+++ b/src/native/unix/native/dso-dyld.c
@@ -41,19 +41,16 @@ static NSModule multiple(NSSymbol s, NSModule om, NSModule nm)
     NSModule ret = nm;
 
     log_debug("Symbol \"%s\" found in modules \"%s\" and \"%s\" (using %s)",
-              NSNameOfSymbol(s), NSNameOfModule(om), NSNameOfModule(nm),
-              NSNameOfModule(ret));
+              NSNameOfSymbol(s), NSNameOfModule(om), NSNameOfModule(nm), NSNameOfModule(ret));
 
     return (ret);
 }
 
 /* We got an error while linking a module, and if it's not a warning we have
    to abort the whole program */
-static void linkedit(NSLinkEditErrors category, int number, const char *file,
-                     const char *message)
+static void linkedit(NSLinkEditErrors category, int number, const char *file, const char *message)
 {
-    log_error("Errors during link edit of file \"%s\" (error=%d): %s", file,
-              number, message);
+    log_error("Errors during link edit of file \"%s\" (error=%d): %s", file, number, message);
     /* Check if this error was only a warning */
     if (category != NSLinkEditWarningError) {
         log_error("Cannot continue");
diff --git a/src/native/unix/native/help.c b/src/native/unix/native/help.c
index 85010ac..5505656 100644
--- a/src/native/unix/native/help.c
+++ b/src/native/unix/native/help.c
@@ -119,10 +119,10 @@ void help(home_data *data)
     printf("    --patch-module=<module name>\n");
     printf("        Java 9 --patch-module option. Passed as it is to JVM\n");
     printf("    --illegal-access=<value>\n");
-    printf("        Java 9 --illegal-access option. Passed as it is to JVM. Refer java help for possible values.\n");
+    printf("        Java 9 --illegal-access option. Passed as it is to JVM.\n");
+    printf("        Refer java help for possible values.\n");
     printf("\njsvc (Apache Commons Daemon) " JSVC_VERSION_STRING "\n");
     printf("Copyright (c) 1999-2019 Apache Software Foundation.\n");
 
     printf("\n");
 }
-
diff --git a/src/native/unix/native/home.c b/src/native/unix/native/home.c
index a189378..8e95c84 100644
--- a/src/native/unix/native/home.c
+++ b/src/native/unix/native/home.c
@@ -149,9 +149,7 @@ static home_data *build(char *path)
     }
 
     while (location_jvm_cfg[x] != NULL) {
-        if ((k =
-             replace(buf, 1024, location_jvm_cfg[x], "$JAVA_HOME",
-                     path)) != 0) {
+        if ((k = replace(buf, 1024, location_jvm_cfg[x], "$JAVA_HOME", path)) != 0) {
             log_error("Error replacing values for jvm.cfg (%d)", k);
             return (NULL);
         }
diff --git a/src/native/unix/native/java.c b/src/native/unix/native/java.c
index 90053e0..45dcf8e 100644
--- a/src/native/unix/native/java.c
+++ b/src/native/unix/native/java.c
@@ -29,18 +29,18 @@ typedef long long __int64;
 #define jsvc_xlate_from_ascii(b) _a2e(b)
 #endif
 #else
-#define jsvc_xlate_to_ascii(b)  /* NOOP */
-#define jsvc_xlate_from_ascii(b)        /* NOOP */
+#define jsvc_xlate_to_ascii(b)         /* NOOP */
+#define jsvc_xlate_from_ascii(b)       /* NOOP */
 #endif
 
 static JavaVM *jvm = NULL;
 static JNIEnv *env = NULL;
-static jclass cls  = NULL;
+static jclass cls = NULL;
 
 #define FALSE 0
 #define TRUE !FALSE
 
-static void shutdown(JNIEnv *env, jobject source, jboolean reload)
+static void shutdown(JNIEnv * env, jobject source, jboolean reload)
 {
     log_debug("Shutdown requested (reload is %d)", reload);
     if (reload == TRUE)
@@ -49,7 +49,7 @@ static void shutdown(JNIEnv *env, jobject source, jboolean reload)
         main_shutdown();
 }
 
-static void failed(JNIEnv *env, jobject source, jstring message)
+static void failed(JNIEnv * env, jobject source, jstring message)
 {
     if (message) {
         const char *msg = (*env)->GetStringUTFChars(env, message, NULL);
@@ -102,7 +102,7 @@ char *java_library(arg_data *args, home_data *data)
     return libf;
 }
 
-typedef jint (*jvm_create_t)(JavaVM **, JNIEnv **, JavaVMInitArgs *);
+typedef jint(*jvm_create_t) (JavaVM **, JNIEnv **, JavaVMInitArgs *);
 
 bool java_signal(void)
 {
@@ -140,16 +140,16 @@ bool java_init(arg_data *args, home_data *data)
     jvm_create_t symb = NULL;
     JNINativeMethod nativemethods[2];
     JavaVMOption *opt = NULL;
-    dso_handle libh   = NULL;
+    dso_handle libh = NULL;
     JavaVMInitArgs arg;
     char *libf = NULL;
     jint ret;
     int x;
-    char loaderclass[]    = LOADER;
+    char loaderclass[] = LOADER;
     char shutdownmethod[] = "shutdown";
     char shutdownparams[] = "(Z)V";
-    char failedmethod[]   = "failed";
-    char failedparams[]   = "(Ljava/lang/String;)V";
+    char failedmethod[] = "failed";
+    char failedparams[] = "(Ljava/lang/String;)V";
     char daemonprocid[64];
     /* Decide WHAT virtual machine we need to use */
     libf = java_library(args, data);
@@ -182,22 +182,20 @@ bool java_init(arg_data *args, home_data *data)
        - JVM 1.6, the library name is libverify.dylib
        - JVM 1.7 onwards, the library name is libjli.dylib
      */
-	if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libverify.dylib",
-				"$JAVA_HOME", data->path) != 0) {
-		log_error("Cannot replace values in loader library");
-		return false;
-	}
+    if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libverify.dylib",
+                "$JAVA_HOME", data->path) != 0) {
+        log_error("Cannot replace values in loader library");
+        return false;
+    }
     if (stat(appf, &sb)) {
-        if (replace(appf, 1024, "$JAVA_HOME/../MacOS/libjli.dylib",
-                    "$JAVA_HOME", data->path) != 0) {
+        if (replace(appf, 1024, "$JAVA_HOME/../MacOS/libjli.dylib", "$JAVA_HOME", data->path) != 0) {
             log_error("Cannot replace values in loader library");
             return false;
         }
     }
     // DAEMON-331 Alternative path for custom OpenJDK builds
     if (stat(appf, &sb)) {
-        if (replace(appf, 1024, "$JAVA_HOME/lib/jli/libjli.dylib",
-                    "$JAVA_HOME", data->path) != 0) {
+        if (replace(appf, 1024, "$JAVA_HOME/lib/jli/libjli.dylib", "$JAVA_HOME", data->path) != 0) {
             log_error("Cannot replace values in loader library");
             return false;
         }
@@ -212,10 +210,10 @@ bool java_init(arg_data *args, home_data *data)
 #if defined(OSD_POSIX)
     /* BS2000 does not allow to call JNI_CreateJavaVM indirectly */
 #else
-    symb = (jvm_create_t)dso_symbol(libh, "JNI_CreateJavaVM");
+    symb = (jvm_create_t) dso_symbol(libh, "JNI_CreateJavaVM");
     if (symb == NULL) {
 #ifdef OS_DARWIN
-        symb = (jvm_create_t)dso_symbol(apph, "JNI_CreateJavaVM");
+        symb = (jvm_create_t) dso_symbol(apph, "JNI_CreateJavaVM");
         if (symb == NULL) {
 #endif /* ifdef OS_DARWIN */
             log_error("Cannot find JVM library entry point");
@@ -239,7 +237,7 @@ bool java_init(arg_data *args, home_data *data)
     }
 #endif
     arg.ignoreUnrecognized = FALSE;
-    arg.nOptions = args->onum + 5; /* pid, ppid, version, class and abort */
+    arg.nOptions = args->onum + 5;     /* pid, ppid, version, class and abort */
     opt = (JavaVMOption *) malloc(arg.nOptions * sizeof(JavaVMOption));
     for (x = 0; x < args->onum; x++) {
         opt[x].optionString = strdup(args->opts[x]);
@@ -247,30 +245,28 @@ bool java_init(arg_data *args, home_data *data)
         opt[x].extraInfo = NULL;
     }
     /* Add our daemon process id */
-    snprintf(daemonprocid, sizeof(daemonprocid),
-             "-Dcommons.daemon.process.id=%d", (int)getpid());
+    snprintf(daemonprocid, sizeof(daemonprocid), "-Dcommons.daemon.process.id=%d", (int)getpid());
     opt[x].optionString = strdup(daemonprocid);
     jsvc_xlate_to_ascii(opt[x].optionString);
-    opt[x++].extraInfo  = NULL;
+    opt[x++].extraInfo = NULL;
 
     snprintf(daemonprocid, sizeof(daemonprocid),
              "-Dcommons.daemon.process.parent=%d", (int)getppid());
     opt[x].optionString = strdup(daemonprocid);
     jsvc_xlate_to_ascii(opt[x].optionString);
-    opt[x++].extraInfo  = NULL;
+    opt[x++].extraInfo = NULL;
 
     snprintf(daemonprocid, sizeof(daemonprocid),
              "-Dcommons.daemon.version=%s", JSVC_VERSION_STRING);
     opt[x].optionString = strdup(daemonprocid);
     jsvc_xlate_to_ascii(opt[x].optionString);
-    opt[x++].extraInfo  = NULL;
+    opt[x++].extraInfo = NULL;
 
     /* DBCP-388. For the benefit of jconsole. */
-    snprintf(daemonprocid, sizeof(daemonprocid),
-             "-Dsun.java.command=%s", args->clas);
+    snprintf(daemonprocid, sizeof(daemonprocid), "-Dsun.java.command=%s", args->clas);
     opt[x].optionString = strdup(daemonprocid);
     jsvc_xlate_to_ascii(opt[x].optionString);
-    opt[x++].extraInfo  = NULL;
+    opt[x++].extraInfo = NULL;
 
     opt[x].optionString = strdup("abort");
     jsvc_xlate_to_ascii(opt[x].optionString);
@@ -288,8 +284,7 @@ bool java_init(arg_data *args, home_data *data)
 
         for (x = 0; x < args->onum; x++) {
             jsvc_xlate_from_ascii(opt[x].optionString);
-            log_debug("|   \"%s\" (0x%08x)", opt[x].optionString,
-                      opt[x].extraInfo);
+            log_debug("|   \"%s\" (0x%08x)", opt[x].optionString, opt[x].extraInfo);
             jsvc_xlate_to_ascii(opt[x].optionString);
         }
         log_debug("+-------------------------------------------------------");
@@ -297,8 +292,7 @@ bool java_init(arg_data *args, home_data *data)
 
         for (; x < arg.nOptions; x++) {
             jsvc_xlate_from_ascii(opt[x].optionString);
-            log_debug("|   \"%s\" (0x%08x)", opt[x].optionString,
-                      opt[x].extraInfo);
+            log_debug("|   \"%s\" (0x%08x)", opt[x].optionString, opt[x].extraInfo);
             jsvc_xlate_to_ascii(opt[x].optionString);
         }
         log_debug("+-------------------------------------------------------");
@@ -384,12 +378,12 @@ bool JVM_destroy(int exit)
 /* Call the load method in our DaemonLoader class */
 bool java_load(arg_data *args)
 {
-    jclass stringClass       = NULL;
-    jstring className        = NULL;
-    jstring currentArgument  = NULL;
+    jclass stringClass = NULL;
+    jstring className = NULL;
+    jstring currentArgument = NULL;
     jobjectArray stringArray = NULL;
-    jmethodID method         = NULL;
-    jboolean ret             = FALSE;
+    jmethodID method = NULL;
+    jboolean ret = FALSE;
     int x;
     char lang[] = "java/lang/String";
     char load[] = "load";
@@ -436,8 +430,7 @@ bool java_load(arg_data *args)
     }
 
     log_debug("Daemon loading...");
-    ret = (*env)->CallStaticBooleanMethod(env, cls, method, className,
-                                          stringArray);
+    ret = (*env)->CallStaticBooleanMethod(env, cls, method, className, stringArray);
     if (ret == FALSE) {
         log_error("Cannot load daemon");
         return false;
@@ -609,4 +602,3 @@ bool java_destroy(void)
     log_debug("Daemon destroyed successfully");
     return true;
 }
-
diff --git a/src/native/unix/native/jsvc-unix.c b/src/native/unix/native/jsvc-unix.c
index 990dede..888905c 100644
--- a/src/native/unix/native/jsvc-unix.c
+++ b/src/native/unix/native/jsvc-unix.c
@@ -41,8 +41,8 @@
 
 #ifdef OS_CYGWIN
 #include <sys/fcntl.h>
-#define F_ULOCK 0               /* Unlock a previously locked region */
-#define F_LOCK  1               /* Lock a region for exclusive use */
+#define F_ULOCK 0                      /* Unlock a previously locked region */
+#define F_LOCK  1                      /* Lock a region for exclusive use */
 #endif
 extern char **environ;
 
@@ -56,10 +56,8 @@ static volatile bool doreload = false;
 static bool doreopen = false;
 static bool dosignal = false;
 
-static int run_controller(arg_data *args, home_data *data, uid_t uid,
-                          gid_t gid);
-static void set_output(char *outfile, char *errfile, bool redirectstdin,
-                       char *procname);
+static int run_controller(arg_data *args, home_data *data, uid_t uid, gid_t gid);
+static void set_output(char *outfile, char *errfile, bool redirectstdin, char *procname);
 
 #ifdef OS_CYGWIN
 /*
@@ -70,14 +68,14 @@ static int lockf(int fildes, int function, off_t size)
     struct flock buf;
 
     switch (function) {
-    case F_LOCK:
-        buf.l_type = F_WRLCK;
-        break;
-    case F_ULOCK:
-        buf.l_type = F_UNLCK;
-        break;
-    default:
-        return -1;
+        case F_LOCK:
+            buf.l_type = F_WRLCK;
+            break;
+        case F_ULOCK:
+            buf.l_type = F_UNLCK;
+            break;
+        default:
+            return -1;
     }
     buf.l_whence = 0;
     buf.l_start = 0;
@@ -99,9 +97,9 @@ static void handler(int sig)
             else {
                 stopping = true;
                 /* Ensure the controller knows a shutdown was requested. */
-                kill(controller_pid,sig);
+                kill(controller_pid, sig);
             }
-        break;
+            break;
         case SIGINT:
             log_debug("Caught SIGINT: Scheduling a shutdown");
             if (stopping == true) {
@@ -110,9 +108,9 @@ static void handler(int sig)
             else {
                 stopping = true;
                 /* Ensure the controller knows a shutdown was requested. */
-                kill(controller_pid,sig);
+                kill(controller_pid, sig);
             }
-        break;
+            break;
         case SIGHUP:
             log_debug("Caught SIGHUP: Scheduling a reload");
             if (stopping == true) {
@@ -122,18 +120,18 @@ static void handler(int sig)
                 stopping = true;
                 doreload = true;
             }
-        break;
+            break;
         case SIGUSR1:
-             log_debug("Caught SIGUSR1: Reopening logs");
-             doreopen = true;
-        break;
+            log_debug("Caught SIGUSR1: Reopening logs");
+            doreopen = true;
+            break;
         case SIGUSR2:
-             log_debug("Caught SIGUSR2: Scheduling a custom signal");
-             dosignal = true;
-        break;
+            log_debug("Caught SIGUSR2: Scheduling a custom signal");
+            dosignal = true;
+            break;
         default:
             log_debug("Caught unknown signal %d", sig);
-        break;
+            break;
     }
 }
 
@@ -147,13 +145,11 @@ static int set_user_group(const char *user, int uid, int gid)
         }
         if (initgroups(user, gid) != 0) {
             if (getuid() != uid) {
-                log_error("Cannot set supplement group list for user '%s'",
-                          user);
+                log_error("Cannot set supplement group list for user '%s'", user);
                 return -1;
             }
             else
-                log_debug("Cannot set supplement group list for user '%s'",
-                          user);
+                log_debug("Cannot set supplement group list for user '%s'", user);
         }
         if (getuid() == uid) {
             log_debug("No need to change user to '%s'!", user);
@@ -195,7 +191,7 @@ static int set_user_group(const char *user, int uid, int gid)
 static int set_legacy_caps(int caps)
 {
     struct __user_cap_header_struct caphead;
-    struct __user_cap_data_struct   cap;
+    struct __user_cap_data_struct cap;
 
     memset(&caphead, 0, sizeof caphead);
     caphead.version = LEGACY_CAP_VERSION;
@@ -229,16 +225,16 @@ static cap_value_t caps_min[] = {
 #define CAPSMIN  2
 
 
-typedef int     (*fd_cap_free)(void *);
-typedef cap_t   (*fd_cap_init)(void);
-typedef int     (*fd_cap_clear)(cap_t);
-typedef int     (*fd_cap_get_flag)(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
-typedef int     (*fd_cap_set_flag)(cap_t, cap_flag_t, int, const cap_value_t *, cap_flag_value_t);
-typedef int     (*fd_cap_set_proc)(cap_t);
+typedef int (*fd_cap_free) (void *);
+typedef cap_t (*fd_cap_init) (void);
+typedef int (*fd_cap_clear) (cap_t);
+typedef int (*fd_cap_get_flag) (cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
+typedef int (*fd_cap_set_flag) (cap_t, cap_flag_t, int, const cap_value_t *, cap_flag_value_t);
+typedef int (*fd_cap_set_proc) (cap_t);
 
 static dso_handle hlibcap = NULL;
-static fd_cap_free  fp_cap_free;
-static fd_cap_init  fp_cap_init;
+static fd_cap_free fp_cap_free;
+static fd_cap_init fp_cap_init;
 static fd_cap_clear fp_cap_clear;
 static fd_cap_get_flag fp_cap_get_flag;
 static fd_cap_set_flag fp_cap_set_flag;
@@ -305,37 +301,37 @@ static int set_caps(int cap_type)
     int ncap;
     int flag = CAP_SET;
     cap_value_t *caps;
-    const char  *type;
+    const char *type;
 
     if (ld_libcap()) {
         return set_legacy_caps(cap_type);
     }
     if (cap_type == CAPS) {
-        ncap = sizeof(caps_std)/sizeof(cap_value_t);
+        ncap = sizeof(caps_std) / sizeof(cap_value_t);
         caps = caps_std;
         type = "default";
     }
     else if (cap_type == CAPSMIN) {
-        ncap = sizeof(caps_min)/sizeof(cap_value_t);
+        ncap = sizeof(caps_min) / sizeof(cap_value_t);
         caps = caps_min;
         type = "min";
     }
     else {
-        ncap = sizeof(caps_min)/sizeof(cap_value_t);
+        ncap = sizeof(caps_min) / sizeof(cap_value_t);
         caps = caps_min;
         type = "null";
         flag = CAP_CLEAR;
     }
-    c = (*fp_cap_init)();
-    (*fp_cap_clear)(c);
-    (*fp_cap_set_flag)(c, CAP_EFFECTIVE,   ncap, caps, flag);
-    (*fp_cap_set_flag)(c, CAP_INHERITABLE, ncap, caps, flag);
-    (*fp_cap_set_flag)(c, CAP_PERMITTED,   ncap, caps, flag);
-    if ((*fp_cap_set_proc)(c) != 0) {
+    c = (*fp_cap_init) ();
+    (*fp_cap_clear) (c);
+    (*fp_cap_set_flag) (c, CAP_EFFECTIVE, ncap, caps, flag);
+    (*fp_cap_set_flag) (c, CAP_INHERITABLE, ncap, caps, flag);
+    (*fp_cap_set_flag) (c, CAP_PERMITTED, ncap, caps, flag);
+    if ((*fp_cap_set_proc) (c) != 0) {
         log_error("failed setting %s capabilities.", type);
         return -1;
     }
-    (*fp_cap_free)(c);
+    (*fp_cap_free) (c);
     if (cap_type == CAPS)
         log_debug("increased capability set.");
     else if (cap_type == CAPSMIN)
@@ -406,7 +402,7 @@ static bool checkuser(char *user, uid_t * uid, gid_t * gid)
 {
     struct passwd *pwds = NULL;
     int status = 0;
-    pid_t pid  = 0;
+    pid_t pid = 0;
 
     /* Do we actually _have_ to switch user? */
     if (user == NULL)
@@ -461,7 +457,7 @@ static void cygwincontroller(void)
     raise(SIGTERM);
 }
 #endif
-static void controller(int sig, siginfo_t *sip, void *ucp)
+static void controller(int sig, siginfo_t * sip, void *ucp)
 {
     switch (sig) {
         case SIGTERM:
@@ -477,10 +473,8 @@ static void controller(int sig, siginfo_t *sip, void *ucp)
                  * child.
                  */
                 stopping = true;
-                if (sip == NULL
-                    || !(sip->si_code <= 0 && sip->si_pid == controlled)) {
-                    log_debug("Forwarding signal %d to process %d", sig,
-                               controlled);
+                if (sip == NULL || !(sip->si_code <= 0 && sip->si_pid == controlled)) {
+                    log_debug("Forwarding signal %d to process %d", sig, controlled);
                     kill(controlled, sig);
                 }
             }
@@ -512,7 +506,7 @@ static int mkdir1(char *name, int perms)
     rc = mkdir0(name, perms);
     if (rc == EEXIST)
         return 0;
-    if (rc == ENOENT) {  /* Missing an intermediate dir */
+    if (rc == ENOENT) {                /* Missing an intermediate dir */
         char *pos;
         if ((pos = strrchr(name, '/'))) {
             *pos = '\0';
@@ -583,8 +577,7 @@ retry:
             buff[i] = '\0';
             pid = atoi(buff);
             if (kill(pid, 0) == 0) {
-                log_error("Still running according to PID file %s, PID is %d",
-                          args->pidf, pid);
+                log_error("Still running according to PID file %s, PID is %d", args->pidf, pid);
                 lockf(fd, F_ULOCK, 0);
                 close(fd);
                 return 122;
@@ -619,15 +612,18 @@ static void remove_pid_file(arg_data *args, int pidn)
     if (i > 0) {
         buff[i] = '\0';
         pid = atoi(buff);
-    } else {
+    }
+    else {
         pid = -1;
     }
     if (pid == pidn) {
         /* delete the file while it's still locked */
         unlink(args->pidf);
-    } else {
-        log_debug("remove_pid_file: pid changed (%d->%d), not removing pid file %s",
-                  pidn, pid, args->pidf);
+    }
+    else {
+        log_debug
+            ("remove_pid_file: pid changed (%d->%d), not removing pid file %s",
+             pidn, pid, args->pidf);
     }
     lockf(fd, F_ULOCK, 0);
     close(fd);
@@ -763,7 +759,7 @@ static int wait_child(arg_data *args, int pid)
                         else
                             return 1;
                     }
-                    return 0; /* ready JVM started */
+                    return 0;          /* ready JVM started */
                 }
             }
         }
@@ -907,11 +903,11 @@ static int child(arg_data *args, home_data *data, uid_t uid, gid_t gid)
         /* pause() is not threadsafe */
         sleep(60);
 #endif
-        if(doreopen) {
+        if (doreopen) {
             doreopen = false;
             set_output(args->outfile, args->errfile, args->redirectstdin, args->procname);
         }
-        if(dosignal) {
+        if (dosignal) {
             dosignal = false;
             java_signal();
         }
@@ -988,7 +984,7 @@ static int logger_child(int out_fd, int err_fd, char *procname)
         if (err_fd != -1) {
             FD_SET(err_fd, &rfds);
         }
-        tv.tv_sec  = 60;
+        tv.tv_sec = 60;
         tv.tv_usec = 0;
         retval = select(nfd, &rfds, NULL, NULL, &tv);
         if (retval == -1) {
@@ -1000,7 +996,7 @@ static int logger_child(int out_fd, int err_fd, char *procname)
         else if (retval) {
             if (out_fd != -1 && FD_ISSET(out_fd, &rfds)) {
                 do {
-                    n = read(out_fd, buf, LOGBUF_SIZE-1);
+                    n = read(out_fd, buf, LOGBUF_SIZE - 1);
                 } while (n == -1 && errno == EINTR);
                 if (n == -1) {
                     syslog(LOG_ERR, "read: %s", strerror(errno));
@@ -1017,7 +1013,7 @@ static int logger_child(int out_fd, int err_fd, char *procname)
             }
             if (err_fd != -1 && FD_ISSET(err_fd, &rfds)) {
                 do {
-                    n = read(err_fd, buf, LOGBUF_SIZE-1);
+                    n = read(err_fd, buf, LOGBUF_SIZE - 1);
                 } while (n == -1 && errno == EINTR);
                 if (n == -1) {
                     syslog(LOG_ERR, "read: %s", strerror(errno));
@@ -1042,8 +1038,8 @@ static int logger_child(int out_fd, int err_fd, char *procname)
  */
 static void set_output(char *outfile, char *errfile, bool redirectstdin, char *procname)
 {
-    int out_pipe[2] = {-1, -1};
-    int err_pipe[2] = {-1, -1};
+    int out_pipe[2] = { -1, -1 };
+    int err_pipe[2] = { -1, -1 };
     int fork_needed = 0;
 
     if (redirectstdin == true) {
@@ -1061,8 +1057,7 @@ static void set_output(char *outfile, char *errfile, bool redirectstdin, char *p
         freopen("/dev/null", "a", stdout);
         /* Send stdout to syslog through a logger process */
         if (pipe(out_pipe) == -1) {
-            log_error("cannot create stdout pipe: %s",
-                      strerror(errno));
+            log_error("cannot create stdout pipe: %s", strerror(errno));
         }
         else {
             fork_needed = 1;
@@ -1080,8 +1075,7 @@ static void set_output(char *outfile, char *errfile, bool redirectstdin, char *p
         freopen("/dev/null", "a", stderr);
         /* Send stderr to syslog through a logger process */
         if (pipe(err_pipe) == -1) {
-            log_error("cannot create stderr pipe: %s",
-                      strerror(errno));
+            log_error("cannot create stderr pipe: %s", strerror(errno));
         }
         else {
             fork_needed = 1;
@@ -1125,15 +1119,13 @@ static void set_output(char *outfile, char *errfile, bool redirectstdin, char *p
                 if (out_pipe[0] != -1) {
                     close(out_pipe[0]);
                     if (dup2(out_pipe[1], 1) == -1) {
-                        log_error("cannot redirect stdout to pipe for syslog: %s",
-                                  strerror(errno));
+                        log_error("cannot redirect stdout to pipe for syslog: %s", strerror(errno));
                     }
                 }
                 if (err_pipe[0] != -1) {
                     close(err_pipe[0]);
                     if (dup2(err_pipe[1], 2) == -1) {
-                        log_error("cannot redirect stderr to pipe for syslog: %s",
-                                  strerror(errno));
+                        log_error("cannot redirect stderr to pipe for syslog: %s", strerror(errno));
                     }
                 }
             }
@@ -1146,11 +1138,11 @@ static void set_output(char *outfile, char *errfile, bool redirectstdin, char *p
 
 int main(int argc, char *argv[])
 {
-    arg_data *args  = NULL;
+    arg_data *args = NULL;
     home_data *data = NULL;
-    pid_t pid  = 0;
-    uid_t uid  = 0;
-    gid_t gid  = 0;
+    pid_t pid = 0;
+    uid_t uid = 0;
+    gid_t gid = 0;
     int res;
 
     /* Parse command line arguments */
@@ -1183,13 +1175,13 @@ int main(int argc, char *argv[])
        loading of VMs (notably this is for Linux). Set, replace, and go. */
     if (strcmp(argv[0], args->procname) != 0) {
         char *oldpath = getenv("LD_LIBRARY_PATH");
-        char *libf    = java_library(args, data);
+        char *libf = java_library(args, data);
         char *filename;
-        char  buf[2048];
-        int   ret;
+        char buf[2048];
+        int ret;
         char *tmp = NULL;
-        char *p1  = NULL;
-        char *p2  = NULL;
+        char *p1 = NULL;
+        char *p2 = NULL;
 
         /* We don't want to use a form of exec() that searches the
          * PATH, so require that argv[0] be either an absolute or
@@ -1207,12 +1199,12 @@ int main(int argc, char *argv[])
          * (additionaly a strdup(NULL) cores dump on my machine).
          */
         if (libf != NULL) {
-            p1  = strdup(libf);
+            p1 = strdup(libf);
             tmp = strrchr(p1, '/');
             if (tmp != NULL)
                 tmp[0] = '\0';
 
-            p2  = strdup(p1);
+            p2 = strdup(p1);
             tmp = strrchr(p2, '/');
             if (tmp != NULL)
                 tmp[0] = '\0';
@@ -1225,8 +1217,7 @@ int main(int argc, char *argv[])
             tmp = strdup(buf);
             setenv("LD_LIBRARY_PATH", tmp, 1);
 
-            log_debug("Invoking w/ LD_LIBRARY_PATH=%s",
-                      getenv("LD_LIBRARY_PATH"));
+            log_debug("Invoking w/ LD_LIBRARY_PATH=%s", getenv("LD_LIBRARY_PATH"));
         }
 
         /* execve needs a full path */
@@ -1266,8 +1257,7 @@ int main(int argc, char *argv[])
     }
 
     if (chdir(args->cwd)) {
-        log_error("ERROR: jsvc was unable to "
-                  "change directory to: %s", args->cwd);
+        log_error("ERROR: jsvc was unable to " "change directory to: %s", args->cwd);
     }
     /*
      * umask() uses inverse logic; bits are CLEAR for allowed access.
@@ -1287,8 +1277,7 @@ int main(int argc, char *argv[])
     return res;
 }
 
-static int run_controller(arg_data *args, home_data *data, uid_t uid,
-                          gid_t gid)
+static int run_controller(arg_data *args, home_data *data, uid_t uid, gid_t gid)
 {
     pid_t pid = 0;
     int restarts = 0;
diff --git a/src/native/unix/native/location.c b/src/native/unix/native/location.c
index 2db0e9c..dd5d4ab 100644
--- a/src/native/unix/native/location.c
+++ b/src/native/unix/native/location.c
@@ -70,15 +70,15 @@ char *location_home[] = {
  * somewhere around JAVA_HOME. (Only two, I'm happy)
  */
 char *location_jvm_cfg[] = {
-    "$JAVA_HOME/jre/lib/jvm.cfg",           /* JDK */
-    "$JAVA_HOME/lib/jvm.cfg",               /* JRE */
-    "$JAVA_HOME/jre/lib/" CPU "/jvm.cfg",   /* JDK */
-    "$JAVA_HOME/lib/" CPU "/jvm.cfg",       /* JRE */
+    "$JAVA_HOME/jre/lib/jvm.cfg",          /* JDK */
+    "$JAVA_HOME/lib/jvm.cfg",              /* JRE */
+    "$JAVA_HOME/jre/lib/" CPU "/jvm.cfg",  /* JDK */
+    "$JAVA_HOME/lib/" CPU "/jvm.cfg",      /* JRE */
 #if defined(OS_AIX)
-    "$JAVA_HOME/jre/lib/ppc/jvm.cfg",       /* JDK */
-    "$JAVA_HOME/lib/ppc/jvm.cfg",           /* JRE */
+    "$JAVA_HOME/jre/lib/ppc/jvm.cfg",      /* JDK */
+    "$JAVA_HOME/lib/ppc/jvm.cfg",          /* JRE */
 #endif
-	NULL,
+    NULL,
 };
 
 /* This is the list of "defaults" VM (searched when jvm.cfg is not found, as
@@ -90,21 +90,21 @@ char *location_jvm_default[] = {
     "$JAVA_HOME/jre/lib/server/libjvm.dylib",
     "$JAVA_HOME/jre/lib/client/libjvm.dylib",
 #elif defined(OS_CYGWIN)
-    "$JAVA_HOME/jre/bin/classic/jvm.dll",               /* Sun JDK 1.3 */
-    "$JAVA_HOME/jre/bin/client/jvm.dll",                /* Sun JDK 1.4 */
+    "$JAVA_HOME/jre/bin/classic/jvm.dll",           /* Sun JDK 1.3 */
+    "$JAVA_HOME/jre/bin/client/jvm.dll",            /* Sun JDK 1.4 */
 #elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_BSD) || defined(OS_SYSV) || defined(OS_FREEBSD) || defined(OS_TRU64) || defined(OS_AIX)
-    "$JAVA_HOME/jre/lib/" CPU "/classic/libjvm.so",     /* Sun JDK 1.2 */
-    "$JAVA_HOME/jre/lib/" CPU "/server/libjvm.so",      /* Sun JDK 1.4 */
-    "$JAVA_HOME/jre/lib/" CPU "/client/libjvm.so",      /* Sun JDK 1.3 */
-    "$JAVA_HOME/jre/lib/" CPU "/libjvm.so",             /* Sun JDK */
-    "$JAVA_HOME/lib/" CPU "/classic/libjvm.so",         /* Sun JRE 1.2 */
-    "$JAVA_HOME/lib/" CPU "/server/libjvm.so",          /* Sun JRE 1.4 */
-    "$JAVA_HOME/lib/" CPU "/client/libjvm.so",          /* Sun JRE 1.3 */
-    "$JAVA_HOME/lib/" CPU "/libjvm.so",                 /* Sun JRE */
-    "$JAVA_HOME/jre/bin/" CPU "/classic/libjvm.so",     /* IBM JDK 1.3 */
-    "$JAVA_HOME/jre/bin/" CPU "/libjvm.so",             /* IBM JDK */
-    "$JAVA_HOME/bin/" CPU "/classic/libjvm.so",         /* IBM JRE 1.3 */
-    "$JAVA_HOME/bin/" CPU "/libjvm.so",                 /* IBM JRE */
+    "$JAVA_HOME/jre/lib/" CPU "/classic/libjvm.so", /* Sun JDK 1.2 */
+    "$JAVA_HOME/jre/lib/" CPU "/server/libjvm.so",  /* Sun JDK 1.4 */
+    "$JAVA_HOME/jre/lib/" CPU "/client/libjvm.so",  /* Sun JDK 1.3 */
+    "$JAVA_HOME/jre/lib/" CPU "/libjvm.so",         /* Sun JDK */
+    "$JAVA_HOME/lib/" CPU "/classic/libjvm.so",     /* Sun JRE 1.2 */
+    "$JAVA_HOME/lib/" CPU "/server/libjvm.so",      /* Sun JRE 1.4 */
+    "$JAVA_HOME/lib/" CPU "/client/libjvm.so",      /* Sun JRE 1.3 */
+    "$JAVA_HOME/lib/" CPU "/libjvm.so",             /* Sun JRE */
+    "$JAVA_HOME/jre/bin/" CPU "/classic/libjvm.so", /* IBM JDK 1.3 */
+    "$JAVA_HOME/jre/bin/" CPU "/libjvm.so",         /* IBM JDK */
+    "$JAVA_HOME/bin/" CPU "/classic/libjvm.so",     /* IBM JRE 1.3 */
+    "$JAVA_HOME/bin/" CPU "/libjvm.so",             /* IBM JRE */
     /* Those are "weirdos: if we got here, we're probably in troubles and
      *  we're not going to find anything, but hope never dies...
      */
@@ -135,7 +135,7 @@ char *location_jvm_default[] = {
     "$JAVA_HOME/jre/lib/" CPU "/hotspot/libjvm." SO_EXT,
     "$JAVA_HOME/jre/lib/" CPU "/classic/libjvm." SO_EXT,
 #endif
-    "/usr/lib/libgcj.so.7",     /* gcc java libraries */
+    "/usr/lib/libgcj.so.7",            /* gcc java libraries */
     "/usr/lib/libgcj.so.6",
     NULL,
 };
@@ -153,7 +153,7 @@ char *location_jvm_configured[] = {
     "$JAVA_HOME/jre/bin/$VM_NAME/jvm.dll",              /* Sun JDK 1.3 */
 #elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_BSD) || defined(OS_FREEBSD) || defined(OS_TRU64) || defined(OS_AIX)
     "$JAVA_HOME/lib/$VM_NAME/libjvm.so",                /* Java 9 */
-	"$JAVA_HOME/jre/lib/" CPU "/$VM_NAME/libjvm.so",    /* Sun JDK 1.3 */
+    "$JAVA_HOME/jre/lib/" CPU "/$VM_NAME/libjvm.so",    /* Sun JDK 1.3 */
     "$JAVA_HOME/lib/" CPU "/$VM_NAME/libjvm.so",        /* Sun JRE 1.3 */
 #if defined(OS_AIX)
     "$JAVA_HOME/jre/lib/ppc/$VM_NAME/libjvm.so",        /* Sun JDK 1.3 */
@@ -170,4 +170,3 @@ char *location_jvm_configured[] = {
 #endif
     NULL,
 };
-
diff --git a/src/native/unix/native/locks.c b/src/native/unix/native/locks.c
index 863be49..85590c5 100644
--- a/src/native/unix/native/locks.c
+++ b/src/native/unix/native/locks.c
@@ -31,12 +31,12 @@ int lockf(int fildes, int function, off_t size)
     switch (function) {
         case F_LOCK:
             buf.l_type = F_WRLCK;
-        break;
+            break;
         case F_ULOCK:
             buf.l_type = F_UNLCK;
-        break;
+            break;
         default:
-        return -1;
+            return -1;
     }
     buf.l_whence = 0;
     buf.l_start = 0;
@@ -47,4 +47,3 @@ int lockf(int fildes, int function, off_t size)
 #else
 const char __unused_locks_c[] = __FILE__;
 #endif
-
diff --git a/src/native/unix/native/replace.c b/src/native/unix/native/replace.c
index d0110f0..772d656 100644
--- a/src/native/unix/native/replace.c
+++ b/src/native/unix/native/replace.c
@@ -77,7 +77,7 @@ int replace(char *new, int len, char *old, char *mch, char *rpl)
      * and of how many bytes we need to shift the data
      */
     shift = rlen - mlen;
-    nlen  = olen + (shift * count);
+    nlen = olen + (shift * count);
     /* printf("Count=%d Shift= %d OLen=%d NLen=%d\n",count,shift,olen,nlen); */
 
     /* Check if we have enough size in the buffer */
@@ -117,4 +117,3 @@ int replace(char *new, int len, char *old, char *mch, char *rpl)
     }
     return 0;
 }
-
diff --git a/src/native/unix/native/signals.c b/src/native/unix/native/signals.c
index c54deec..209cfda 100644
--- a/src/native/unix/native/signals.c
+++ b/src/native/unix/native/signals.c
@@ -36,7 +36,7 @@ void v_difthf(LPVOID par)
     for (;;) {
         if (WaitForSingleObject(hevint, INFINITE) == WAIT_FAILED) {
             /* something have gone wrong. */
-            return;             /* may be something more is needed. */
+            return;                    /* may be something more is needed. */
         }
 
         /* call the interrupt handler. */
@@ -83,21 +83,20 @@ int SetTerm(void (*func) (void))
     HandleTerm = func;
 
     if (hevint == NULL)
-        return -1;            /* failed */
+        return -1;                     /* failed */
 
     /* create the thread to wait for event */
     hthread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) v_difthf,
                            (LPVOID) hevint, 0, &ThreadId);
     if (hthread == NULL) {
         /* failed remove the event */
-        CloseHandle(hevint);    /* windows will remove it. */
+        CloseHandle(hevint);           /* windows will remove it. */
         return -1;
     }
 
-    CloseHandle(hthread);       /* not needed */
+    CloseHandle(hthread);              /* not needed */
     return 0;
 }
 #else
 const char __unused_signals_c[] = __FILE__;
 #endif
-


[commons-daemon] 01/03: Update format to better align with current code style

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git

commit a9bee1b094fdca786b8184f453f13fcbf8b01576
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 19 11:15:17 2019 +0100

    Update format to better align with current code style
---
 src/native/unix/native/.indent.pro | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/native/unix/native/.indent.pro b/src/native/unix/native/.indent.pro
index 29abe67..64e184a 100644
--- a/src/native/unix/native/.indent.pro
+++ b/src/native/unix/native/.indent.pro
@@ -14,10 +14,10 @@
  * limitations under the License.
  */
 
--i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 -nut -ncs
+-i4 -npsl -di0 -br -nce -d0 -cli4 -npcs -nfc1 -nut -ncs -nbbo -l100 -c40
 -Tbool
 -Targ_data
 -Thome_data
 -Thome_jvm
 -Tdso_handle
-
+-Tcap_t


[commons-daemon] 03/03: Format tweak

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git

commit 60d1a6a4452e0ae1ce24095c086627a6b246047e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 19 11:19:04 2019 +0100

    Format tweak
---
 src/native/unix/native/.indent.pro | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/native/unix/native/.indent.pro b/src/native/unix/native/.indent.pro
index 64e184a..29c4237 100644
--- a/src/native/unix/native/.indent.pro
+++ b/src/native/unix/native/.indent.pro
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
--i4 -npsl -di0 -br -nce -d0 -cli4 -npcs -nfc1 -nut -ncs -nbbo -l100 -c40
+-i4 -npsl -di0 -br -nce -d0 -cli4 -npcs -nfc1 -nut -ncs -nbbo -l100 -c40 -il0
 -Tbool
 -Targ_data
 -Thome_data