update/
[ltt-control.git] / ltt-control / lttd / lttd.c
index 2601d805df0187e82019d1460ffbfd5efeee219f..fea1188e600acb24454ad5e460f800ee28f9991b 100644 (file)
@@ -205,12 +205,12 @@ int open_channel_trace_pairs(char *subchannel_name, char *subtrace_name,
        char path_trace[PATH_MAX];
        int path_trace_len;
        char *path_trace_ptr;
-  int open_ret = 0;
+       int open_ret = 0;
 
        if(channel_dir == NULL) {
                perror(subchannel_name);
                open_ret = ENOENT;
-    goto end;
+               goto end;
        }
 
        printf("Creating trace subdirectory %s\n", subtrace_name);
@@ -218,7 +218,7 @@ int open_channel_trace_pairs(char *subchannel_name, char *subtrace_name,
        if(ret == -1) {
                if(errno != EEXIST) {
                        perror(subtrace_name);
-      open_ret = -1;
+                       open_ret = -1;
                        goto end;
                }
        }
@@ -285,7 +285,7 @@ int open_channel_trace_pairs(char *subchannel_name, char *subtrace_name,
                                } else {
                                        printf("File %s exists, cannot open. Try append mode.\n", path_trace);
                                        open_ret = -1;
-          goto end;
+                                       goto end;
                                }
                        } else {
                                if(errno == ENOENT) {
@@ -318,7 +318,7 @@ int read_subbuffer(struct fd_pair *pair)
        printf("cookie : %u\n", consumed_old);
        if(err != 0) {
                ret = errno;
-               perror("Reserving sub buffer failed (everything is normal)");
+               perror("Reserving sub buffer failed (everything is normal, it is due to concurrency)");
                goto get_error;
        }
        
@@ -344,9 +344,9 @@ write_error:
        err = ioctl(pair->channel, RELAYFS_PUT_SUBBUF, &consumed_old);
        if(err != 0) {
                ret = errno;
-               if(errno == -EFAULT) {
+               if(errno == EFAULT) {
                        perror("Error in unreserving sub buffer\n");
-               } else if(errno == -EIO) {
+               } else if(errno == EIO) {
                        perror("Reader has been pushed by the writer, last subbuffer corrupted.");
                        /* FIXME : we may delete the last written buffer if we wish. */
                }
@@ -534,7 +534,7 @@ void * read_channels(void *arg)
                                                high_prio = 1;
                                                /* it's ok to have an unavailable subbuffer */
                                                ret = read_subbuffer(&fd_pairs->pair[i]);
-                                               if(ret == -EAGAIN) ret = 0;
+                                               if(ret == EAGAIN) ret = 0;
 
                                                ret = pthread_mutex_unlock(&fd_pairs->pair[i].mutex);
                                                if(ret)
@@ -555,7 +555,7 @@ void * read_channels(void *arg)
                                                        printf("Normal read on fd %d\n", pollfd[i].fd);
                                                        /* it's ok to have an unavailable subbuffer */
                                                        ret = read_subbuffer(&fd_pairs->pair[i]);
-                                                       if(ret == -EAGAIN) ret = 0;
+                                                       if(ret == EAGAIN) ret = 0;
 
                                                        ret = pthread_mutex_unlock(&fd_pairs->pair[i].mutex);
                                                        if(ret)
@@ -609,12 +609,12 @@ int main(int argc, char ** argv)
 
        if(daemon_mode) {
                ret = daemon(0, 0);
-    
-    if(ret == -1) {
-      perror("An error occured while daemonizing.");
-      exit(-1);
-    }
-  }
+               
+               if(ret == -1) {
+                       perror("An error occured while daemonizing.");
+                       exit(-1);
+               }
+       }
 
        /* Connect the signal handlers */
        act.sa_handler = handler;
This page took 0.025009 seconds and 4 git commands to generate.