168 |
setbuf(stdout,0); |
setbuf(stdout,0); |
169 |
|
|
170 |
#define INIT_CORE_END terminal_io->sm.sm_object0->sm.sm_fp = stdin;terminal_io->sm.sm_object1->sm.sm_fp = stdout; |
#define INIT_CORE_END terminal_io->sm.sm_object0->sm.sm_fp = stdin;terminal_io->sm.sm_object1->sm.sm_fp = stdout; |
171 |
|
|
172 |
|
#include <limits.h> |
173 |
|
#include <sys/stat.h> |
174 |
|
#define GET_FULL_PATH_SELF(a_) do {\ |
175 |
|
char b[20];\ |
176 |
|
static char q[PATH_MAX];\ |
177 |
|
struct stat ss;\ |
178 |
|
if (snprintf(b,sizeof(b),"/proc/%d/exe",getpid())<=0)\ |
179 |
|
error("Cannot write proc exe pathname");\ |
180 |
|
if (stat(b,&ss)) \ |
181 |
|
(a_)=argv[0];\ |
182 |
|
else {\ |
183 |
|
if (!realpath(b,q)) \ |
184 |
|
error("realpath error");\ |
185 |
|
(a_)=q;\ |
186 |
|
}\ |
187 |
|
} while(0) |