From 618fbcc124c0a599c7396d29bd33b3d2585c245a Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 16 Sep 2005 00:43:07 +0000 Subject: [PATCH] fix errno git-svn-id: http://ltt.polymtl.ca/svn@1207 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttctl/lttctl.c | 13 +++++++------ .../poly/lttv/modules/gui/controlflow/eventhooks.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ltt/branches/poly/lttctl/lttctl.c b/ltt/branches/poly/lttctl/lttctl.c index 080518d8..59eedfc0 100644 --- a/ltt/branches/poly/lttctl/lttctl.c +++ b/ltt/branches/poly/lttctl/lttctl.c @@ -282,9 +282,9 @@ int create_eventdefs(void) ret = mkdir(trace_root, S_IRWXU|S_IRWXG|S_IRWXO); if(ret == -1 && errno != EEXIST) { + ret = errno; perror("Cannot create trace_root directory"); printf("trace_root is %s\n", trace_root); - ret = errno; goto error; } ret = 0; @@ -295,8 +295,8 @@ int create_eventdefs(void) size_t eventdefs_path_len = strlen(eventdefs_path); ret = mkdir(eventdefs_path, S_IRWXU|S_IRWXG|S_IRWXO); if(ret == -1 && (!append_trace || errno != EEXIST)) { - perror("Cannot create eventdefs directory"); ret = errno; + perror("Cannot create eventdefs directory"); goto error; } ret = 0; @@ -327,8 +327,8 @@ int create_eventdefs(void) strncat(facilities_file, entry->d_name, PATH_MAX - facilities_dir_len-1); FILE *src = fopen(facilities_file, "r"); if(!src) { - perror("Cannot open eventdefs file for reading"); ret = errno; + perror("Cannot open eventdefs file for reading"); goto close_dest; } @@ -336,14 +336,14 @@ int create_eventdefs(void) size_t read_size, write_size; read_size = fread(read_buf, sizeof(char), BUF_SIZE, src); if(ferror(src)) { - perror("Cannot read eventdefs file"); ret = errno; + perror("Cannot read eventdefs file"); goto close_src; } write_size = fwrite(read_buf, sizeof(char), read_size, dest); if(ferror(dest)) { - perror("Cannot write eventdefs file"); ret = errno; + perror("Cannot write eventdefs file"); goto close_src; } } while(!feof(src)); @@ -416,8 +416,9 @@ int lttctl_daemon(struct lttctl_handle *handle, char *trace_name) ret = execlp(lttd_path, lttd_path, "-t", trace_root, "-c", channel_path, "-d", NULL); if(ret) { + ret = errno; perror("Error in executing the lttd daemon"); - exit(errno); + exit(ret); } } else { /* error */ diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c index 1149e1b9..c2b16dfa 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -158,7 +158,7 @@ static void request_background_data(ControlFlowData *control_flow_data) } } else { /* Data ready. Be its nature, this viewer doesn't need to have - * its data ready hook called htere, because a background + * its data ready hook called there, because a background * request is always linked with a redraw. */ } -- 2.34.1