summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-12-09 09:27:02 +0100
committerThomas Haller <thaller@redhat.com>2016-12-15 17:52:32 +0100
commitf16a9a229995fb39416157483eb14f214e616617 (patch)
tree549bcd95355caa7e9931383456b2c2c2deca9ca6
parentf39138ea4813f48de95a1e7568fbda9f7493beff (diff)
device/wwan: use nm_auto_close instead of gs_fd_close
(cherry picked from commit ed299cc8605a8291a61b3a514f8dc20390b18c77)
-rw-r--r--src/devices/wwan/nm-modem.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c
index bf3aa3b28..57e63415e 100644
--- a/src/devices/wwan/nm-modem.c
+++ b/src/devices/wwan/nm-modem.c
@@ -496,18 +496,18 @@ ppp_stats (NMPPPManager *ppp_manager,
static gboolean
port_speed_is_zero (const char *port)
{
- struct termios options;
- gs_fd_close int fd = -1;
+ struct termios options;
+ nm_auto_close int fd = -1;
- fd = open (port, O_RDWR | O_NONBLOCK | O_NOCTTY);
- if (fd < 0)
+ fd = open (port, O_RDWR | O_NONBLOCK | O_NOCTTY);
+ if (fd < 0)
return FALSE;
- memset (&options, 0, sizeof (struct termios));
- if (tcgetattr (fd, &options) != 0)
- return FALSE;
+ memset (&options, 0, sizeof (struct termios));
+ if (tcgetattr (fd, &options) != 0)
+ return FALSE;
- return cfgetospeed (&options) == B0;
+ return cfgetospeed (&options) == B0;
}
static NMActStageReturn