chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: hide output of sysv scripts if quiet is passed on the kernel cmdline
[elogind.git]
/
src
/
hostname-setup.c
diff --git
a/src/hostname-setup.c
b/src/hostname-setup.c
index 3b988d4c8b68dfdad2c25c545d736e0adb4b470a..e0257166d8c267094c918d5f419a1890fabced34 100644
(file)
--- a/
src/hostname-setup.c
+++ b/
src/hostname-setup.c
@@
-30,8
+30,6
@@
#include "util.h"
#include "log.h"
#include "util.h"
#include "log.h"
-#define LINE_MAX 4096
-
#if defined(TARGET_FEDORA)
#define FILENAME "/etc/sysconfig/network"
#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
#if defined(TARGET_FEDORA)
#define FILENAME "/etc/sysconfig/network"
#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
@@
-52,7
+50,8
@@
static char* strip_bad_chars(char *s) {
(*p >= 'A' && *p <= 'Z') ||
(*p >= '0' && *p <= '9') ||
*p == '-' ||
(*p >= 'A' && *p <= 'Z') ||
(*p >= '0' && *p <= '9') ||
*p == '-' ||
- *p == '_')
+ *p == '_' ||
+ *p == '.')
*(d++) = *p;
*d = 0;
*(d++) = *p;
*d = 0;
@@
-102,10
+101,11
@@
static int read_hostname(char **hn) {
}
*hn = k;
}
*hn = k;
- break;
+ r = 0;
+ goto finish;
}
}
- r =
0
;
+ r =
-ENOENT
;
finish:
fclose(f);
finish:
fclose(f);