Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1a26e1c

Browse files
committed
Add strerror() string to chdir() error message
1 parent21c09e9 commit1a26e1c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/port/exec.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
#include<unistd.h>
2727

2828
#ifndefFRONTEND
29-
/* We use only 3-parameter elog calls in this file, for simplicity */
29+
/* We use only 3- and 4-parameter elog calls in this file, for simplicity */
3030
/* NOTE: caller must provide gettext call around str! */
3131
#definelog_error(str,param)elog(LOG, str, param)
32+
#definelog_error4(str,param,arg1)elog(LOG, str, param, arg1)
3233
#else
3334
#definelog_error(str,param)(fprintf(stderr, str, param), fputc('\n', stderr))
35+
#definelog_error4(str,param,arg1)(fprintf(stderr, str, param, arg1), fputc('\n', stderr))
3436
#endif
3537

3638
#ifdefWIN32_ONLY_COMPILER
@@ -252,7 +254,7 @@ resolve_symlinks(char *path)
252254
*lsep='\0';
253255
if (chdir(path)==-1)
254256
{
255-
log_error(_("could not change directory to \"%s\""),path);
257+
log_error4(_("could not change directory to \"%s\": %s"),path,strerror(errno));
256258
return-1;
257259
}
258260
fname=lsep+1;
@@ -288,7 +290,7 @@ resolve_symlinks(char *path)
288290

289291
if (chdir(orig_wd)==-1)
290292
{
291-
log_error(_("could not change directory to \"%s\""),orig_wd);
293+
log_error4(_("could not change directory to \"%s\": %s"),orig_wd,strerror(errno));
292294
return-1;
293295
}
294296
#endif/* HAVE_READLINK */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp