fix error handling
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 24 Mar 2006 17:08:51 +0000 (17:08 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 24 Mar 2006 17:08:51 +0000 (17:08 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1719 04897980-b3bd-0310-b5e0-8ef037075253

ltt-control/lttd/lttd.c

index 2601d805df0187e82019d1460ffbfd5efeee219f..0deb40230a61007fffc235660d055f19d529e092 100644 (file)
@@ -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)
This page took 0.02442 seconds and 4 git commands to generate.