Indentation and whitespace fixes.

There were many combinations of tab-width used so making the
indentation look right in the editor wasn't really possible.

The changes made:
- All tabs replaced with spaces.
- Indentation depth 4.
- , followed by space.
- Most binary operators (*, =, -) surrounded by one space.
- No space following ( or before ).
- Keywords follwed by 1 space.
This commit is contained in:
Johan Wikman
2015-10-29 15:07:30 +02:00
parent 1f22e2854b
commit b543f36a49

View File

@ -1332,7 +1332,8 @@ int main(int argc, char **argv)
{ {
if (pipe(daemon_pipe) == -1) if (pipe(daemon_pipe) == -1)
{ {
fprintf(stderr,"Error: Failed to create pipe for inter-process communication: %d %s",errno,strerror(errno)); fprintf(stderr, "Error: Failed to create pipe for inter-process communication: %d %s",
errno, strerror(errno));
rc = MAXSCALE_INTERNALERROR; rc = MAXSCALE_INTERNALERROR;
goto return_main; goto return_main;
} }
@ -2228,7 +2229,9 @@ bool pid_file_exists()
/** no such process, old PID file */ /** no such process, old PID file */
if (lock_failed) if (lock_failed)
{ {
char* logerr = "Locking the PID file '%s' failed. Read PID from file and no process found with PID %d. " char* logerr =
"Locking the PID file '%s' failed. "
"Read PID from file and no process found with PID %d. "
"Confirm that no other process holds the lock on the PID file."; "Confirm that no other process holds the lock on the PID file.";
snprintf(logbuf, sizeof(logbuf), logerr, pathbuf, pid); snprintf(logbuf, sizeof(logbuf), logerr, pathbuf, pid);
print_log_n_stderr(true, true, logbuf, logbuf, 0); print_log_n_stderr(true, true, logbuf, logbuf, 0);
@ -2246,8 +2249,10 @@ bool pid_file_exists()
} }
else else
{ {
char* logerr = "MaxScale is already running. Process id: %d. " char* logerr =
"Use another location for the PID file to run multiple instances of MaxScale on the same machine."; "MaxScale is already running. Process id: %d. "
"Use another location for the PID file to run multiple "
"instances of MaxScale on the same machine.";
snprintf(logbuf, sizeof(logbuf), logerr, pid); snprintf(logbuf, sizeof(logbuf), logerr, pid);
print_log_n_stderr(true, true, logbuf, logbuf, 0); print_log_n_stderr(true, true, logbuf, logbuf, 0);
unlock_pidfile(); unlock_pidfile();
@ -2293,8 +2298,10 @@ static int write_pid_file() {
{ {
if (errno == EWOULDBLOCK) if (errno == EWOULDBLOCK)
{ {
snprintf(logbuf,sizeof(logbuf),"Failed to lock PID file '%s', another process is holding a lock on it. " snprintf(logbuf, sizeof(logbuf),
"Please confirm that no other MaxScale process is using the same PID file location.",pidfile); "Failed to lock PID file '%s', another process is holding a lock on it. "
"Please confirm that no other MaxScale process is using the same "
"PID file location.", pidfile);
} }
else else
{ {