MCPcopy Create free account
hub / github.com/git/git / add_mailname_host

Function add_mailname_host

ident.c:80–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static int add_mailname_host(struct strbuf *buf)
81{
82 FILE *mailname;
83 struct strbuf mailnamebuf = STRBUF_INIT;
84
85 mailname = fopen_or_warn("/etc/mailname", "r");
86 if (!mailname)
87 return -1;
88
89 if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
90 if (ferror(mailname))
91 warning_errno("cannot read /etc/mailname");
92 strbuf_release(&mailnamebuf);
93 fclose(mailname);
94 return -1;
95 }
96 /* success! */
97 strbuf_addbuf(buf, &mailnamebuf);
98 strbuf_release(&mailnamebuf);
99 fclose(mailname);
100 return 0;
101}
102
103static int canonical_name(const char *host, struct strbuf *out)
104{

Callers 1

copy_emailFunction · 0.85

Calls 5

fopen_or_warnFunction · 0.85
strbuf_getlineFunction · 0.85
warning_errnoFunction · 0.85
strbuf_releaseFunction · 0.85
strbuf_addbufFunction · 0.85

Tested by

no test coverage detected