Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177596683
D26606.1794815617.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D26606.1794815617.diff
View Options
Index: usr.sbin/ctld/ctld.c
===================================================================
--- usr.sbin/ctld/ctld.c
+++ usr.sbin/ctld/ctld.c
@@ -931,7 +931,7 @@
isns_register(struct isns *isns, struct isns *oldisns)
{
struct conf *conf = isns->i_conf;
- int s;
+ int error, s;
char hostname[256];
if (TAILQ_EMPTY(&conf->conf_targets) ||
@@ -943,8 +943,10 @@
set_timeout(0, false);
return;
}
- gethostname(hostname, sizeof(hostname));
-
+ error = gethostname(hostname, sizeof(hostname));
+ if (error != 0)
+ log_err(1, "gethostname");
+
if (oldisns == NULL || TAILQ_EMPTY(&oldisns->i_conf->conf_targets))
oldisns = isns;
isns_do_deregister(oldisns, s, hostname);
@@ -957,7 +959,7 @@
isns_check(struct isns *isns)
{
struct conf *conf = isns->i_conf;
- int s, res;
+ int error, s, res;
char hostname[256];
if (TAILQ_EMPTY(&conf->conf_targets) ||
@@ -969,8 +971,10 @@
set_timeout(0, false);
return;
}
- gethostname(hostname, sizeof(hostname));
-
+ error = gethostname(hostname, sizeof(hostname));
+ if (error != 0)
+ log_err(1, "gethostname");
+
res = isns_do_check(isns, s, hostname);
if (res < 0) {
isns_do_deregister(isns, s, hostname);
@@ -984,7 +988,7 @@
isns_deregister(struct isns *isns)
{
struct conf *conf = isns->i_conf;
- int s;
+ int error, s;
char hostname[256];
if (TAILQ_EMPTY(&conf->conf_targets) ||
@@ -994,8 +998,10 @@
s = isns_do_connect(isns);
if (s < 0)
return;
- gethostname(hostname, sizeof(hostname));
-
+ error = gethostname(hostname, sizeof(hostname));
+ if (error != 0)
+ log_err(1, "gethostname");
+
isns_do_deregister(isns, s, hostname);
close(s);
set_timeout(0, false);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 7:53 AM (15 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41767728
Default Alt Text
D26606.1794815617.diff (1 KB)
Attached To
Mode
D26606: Don't ignore return value from gethostname(3)
Attached
Detach File
Event Timeline