Merge pull request #6992 from Andy2244/wsdd2-fix
wsdd2: fix invalid error message
This commit is contained in:
commit
3ca6e420bc
2 changed files with 11 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=wsdd2
|
PKG_NAME:=wsdd2
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://github.com/Andy2244/wsdd2.git
|
PKG_SOURCE_URL:=https://github.com/Andy2244/wsdd2.git
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
--- a/wsd.c 2018-07-20
|
--- a/wsd.c 2018-07-24
|
||||||
+++ b/wsd.c 2018-07-20
|
+++ b/wsd.c 2018-09-10
|
||||||
@@ -97,12 +97,17 @@ static void uuid_endpoint(char *uuid, si
|
@@ -96,13 +96,19 @@ static void uuid_endpoint(char *uuid, si
|
||||||
|
{
|
||||||
FILE *fp = fopen("/etc/machine-id", "r");
|
FILE *fp = fopen("/etc/machine-id", "r");
|
||||||
int c, i = 0;
|
int c, i = 0;
|
||||||
|
+
|
||||||
+ if (!fp) {
|
+ if (!fp) {
|
||||||
+ DEBUG(0, W, "Can't open '/etc/machine-id', trying '/proc/sys/kernel/random/boot_id'");
|
|
||||||
+ fp = fopen("/proc/sys/kernel/random/boot_id", "r");
|
+ fp = fopen("/proc/sys/kernel/random/boot_id", "r");
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
if (!fp)
|
- if (!fp)
|
||||||
|
+ if (!fp) {
|
||||||
|
+ DEBUG(0, W, "Can't open required '/etc/machine-id' or '/proc/sys/kernel/random/boot_id'");
|
||||||
return;
|
return;
|
||||||
|
+ }
|
||||||
|
|
||||||
while (i < 36 && (c = getc(fp)) != EOF &&
|
while (i < 36 && (c = getc(fp)) != EOF &&
|
||||||
- (isdigit(c) || (islower(c) && isxdigit(c)))) {
|
- (isdigit(c) || (islower(c) && isxdigit(c)))) {
|
||||||
|
|
Loading…
Reference in a new issue