diff options
author | Thomas Haller <thaller@redhat.com> | 2016-12-09 09:27:02 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-12-13 11:26:58 +0100 |
commit | ed299cc8605a8291a61b3a514f8dc20390b18c77 (patch) | |
tree | 65e422f8662d307ef791a4a423062690e35754fe | |
parent | 312cea870dfbc363da44074bd6f56ccd283c5420 (diff) |
device/wwan: use nm_auto_close instead of gs_fd_close
-rw-r--r-- | src/devices/wwan/nm-modem.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c index df7101774..1c72c70e0 100644 --- a/src/devices/wwan/nm-modem.c +++ b/src/devices/wwan/nm-modem.c @@ -497,18 +497,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 |