File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,12 @@ static int add_mailname_host(struct strbuf *buf)
75
75
mailname = fopen ("/etc/mailname" , "r" );
76
76
if (!mailname ) {
77
77
if (errno != ENOENT )
78
- warning ("cannot open /etc/mailname: %s" ,
79
- strerror (errno ));
78
+ warning_errno ("cannot open /etc/mailname" );
80
79
return -1 ;
81
80
}
82
81
if (strbuf_getline (& mailnamebuf , mailname ) == EOF ) {
83
82
if (ferror (mailname ))
84
- warning ("cannot read /etc/mailname: %s" ,
85
- strerror (errno ));
83
+ warning_errno ("cannot read /etc/mailname" );
86
84
strbuf_release (& mailnamebuf );
87
85
fclose (mailname );
88
86
return -1 ;
@@ -125,7 +123,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
125
123
char buf [1024 ];
126
124
127
125
if (gethostname (buf , sizeof (buf ))) {
128
- warning ("cannot get host name: %s" , strerror ( errno ) );
126
+ warning_errno ("cannot get host name" );
129
127
strbuf_addstr (out , "(none)" );
130
128
* is_bogus = 1 ;
131
129
return ;
You can’t perform that action at this time.
0 commit comments