Simplify the code a little.
Submitted by: rppokala Sponsored by: Netflix
This commit is contained in:
parent
05dad2b781
commit
62fd382c43
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315740
@ -110,9 +110,7 @@ auto_exists_status(const char *ty_name)
|
||||
asprintf(&dev, "%s", ty_name);
|
||||
else
|
||||
asprintf(&dev, "/dev/%s", ty_name);
|
||||
if (dev == NULL)
|
||||
return 0;
|
||||
if (stat(dev, &sb) == 0)
|
||||
if (dev != NULL && stat(dev, &sb) == 0)
|
||||
rv = TTY_ON;
|
||||
free(dev);
|
||||
return (rv);
|
||||
|
Loading…
Reference in New Issue
Block a user