From: Daniil Ruban Date: Thu, 9 May 2024 05:05:25 +0000 (+0200) Subject: Fixes error message on error in carrier file X-Git-Tag: accepted/tizen/unified/20240930.043759~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F61%2F310861%2F1;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Fixes error message on error in carrier file - Fix based on https://bugzilla.redhat.com/show_bug.cgi?id=1253797 - In short: If on read carrier file EINVAL happens - that's not an error, but shows that interface is disabled Change-Id: I92f660e6e214f3ba7d710fcf192952550a947bd8 Signed-off-by: Daniil Ruban --- diff --git a/src/network-monitor.c b/src/network-monitor.c index 4d9b85c..d456335 100755 --- a/src/network-monitor.c +++ b/src/network-monitor.c @@ -60,10 +60,15 @@ int netconfig_ethernet_cable_plugin_status_check() errno = 0; rv = fscanf(fd, "%d", &ret); if (rv < 0) { - ERR("Error! Failed to read from file, rv:[%d], error:[%s]", - rv, strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER)); - fclose(fd); - return -1; + // EINVAL is not error -> https://bugzilla.redhat.com/show_bug.cgi?id=1253797 + if (errno == EINVAL) { + ret = 0; + } else { + ERR("Error! Failed to read from file, rv:[%d], error:[%s]", + rv, strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER)); + fclose(fd); + return -1; + } } if (ret == 1) {