mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-27 02:30:39 +02:00
device/wwan: use nm_auto_close instead of gs_fd_close
(cherry picked from commit ed299cc860)
This commit is contained in:
parent
f39138ea48
commit
f16a9a2299
1 changed files with 8 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue