No need to use perror() after td_verror()
authorJens Axboe <jens.axboe@oracle.com>
Mon, 19 Mar 2007 10:32:46 +0000 (11:32 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 19 Mar 2007 10:32:46 +0000 (11:32 +0100)
That'll just result in the error being displayed twice.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
memory.c

index f108e47..384b806 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -70,14 +70,12 @@ int allocate_io_mem(struct thread_data *td)
                td->shm_id = shmget(IPC_PRIVATE, td->orig_buffer_size, flags);
                if (td->shm_id < 0) {
                        td_verror(td, errno, "shmget");
-                       perror("shmget");
                        return 1;
                }
 
                td->orig_buffer = shmat(td->shm_id, NULL, 0);
                if (td->orig_buffer == (void *) -1) {
                        td_verror(td, errno, "shmat");
-                       perror("shmat");
                        td->orig_buffer = NULL;
                        return 1;
                }
@@ -91,8 +89,7 @@ int allocate_io_mem(struct thread_data *td)
                        td->mmapfd = open(td->mmapfile, O_RDWR|O_CREAT, 0644);
 
                        if (td->mmapfd < 0) {
-                               td_verror(td, errno, "open");
-                               perror("open mmap file");
+                               td_verror(td, errno, "open mmap file");
                                td->orig_buffer = NULL;
                                return 1;
                        }
@@ -102,7 +99,6 @@ int allocate_io_mem(struct thread_data *td)
                td->orig_buffer = mmap(NULL, td->orig_buffer_size, PROT_READ | PROT_WRITE, flags, td->mmapfd, 0);
                if (td->orig_buffer == MAP_FAILED) {
                        td_verror(td, errno, "mmap");
-                       perror("mmap");
                        td->orig_buffer = NULL;
                        if (td->mmapfd) {
                                close(td->mmapfd);