Skip to content

Commit ea8ed80

Browse files
authored
Workaround unexpected compilation bug (#108)
Changed Log Added errno info
1 parent 05e53e3 commit ea8ed80

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

src/pipe_mgr/shared/dal/dpdk/dal_init.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ int dal_enable_pipeline(bf_dev_id_t dev_id,
117117
LOG_TRACE("Running command: %s\n", buffer);
118118
status = system(buffer);
119119
if (status) {
120+
LOG_ERROR("%s line:%d Command (%s) failed with exit code: %d, with errno: %d\n",
121+
__func__, __LINE__, buffer, status, errno);
122+
}
123+
// TODO: Ideally, we should check whether status is 0 below. But
124+
// sometimes the returned status code is -1, even when the .o file is
125+
// generated properly. Checking file existence is a temporary
126+
// workaround. Need to further investigate and solve this issue.
127+
fd = fopen(o_filepath, "r");
128+
if (!fd) {
120129
LOG_ERROR("%s line:%d Cannot generate %s file\n",
121130
__func__, __LINE__, o_filepath);
122131
return BF_INTERNAL_ERROR;
@@ -128,13 +137,11 @@ int dal_enable_pipeline(bf_dev_id_t dev_id,
128137
LOG_TRACE("Running command: %s\n", buffer);
129138
status = system(buffer);
130139
if (status) {
131-
LOG_ERROR("%s line:%d Command (%s) failed with exit code: %d\n",
132-
__func__, __LINE__, buffer, status);
140+
LOG_ERROR("%s line:%d Command (%s) failed with exit code: %d, with errno: %d\n",
141+
__func__, __LINE__, buffer, status, errno);
133142
}
134143
// TODO: Ideally, we should check whether status is 0 below. But
135-
// sometimes the returned status code is -1, even when the .so file is
136-
// generated properly. Checking file existence is a temporary
137-
// workaround. Need to further investigate and solve this issue.
144+
// sometimes we have the same issue like the one above for the .so
138145
fd = fopen(so_filepath, "r");
139146
if (!fd) {
140147
LOG_ERROR("%s line:%d Cannot generate %s file\n",

0 commit comments

Comments
 (0)