forked from enlightenment/efl
ecore-drm: Trap for failure to dup stdin
Summary: If we fail to duplicate stdin, we should write out an error and exit appropriately. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
559b7d7ee6
commit
37d21a4729
|
@ -152,7 +152,14 @@ ecore_drm_tty_open(Ecore_Drm_Device *dev, const char *name)
|
||||||
if ((env = getenv("ECORE_DRM_TTY")))
|
if ((env = getenv("ECORE_DRM_TTY")))
|
||||||
snprintf(tty, sizeof(tty), "%s", env);
|
snprintf(tty, sizeof(tty), "%s", env);
|
||||||
else
|
else
|
||||||
dev->tty.fd = dup(STDIN_FILENO);
|
{
|
||||||
|
dev->tty.fd = dup(STDIN_FILENO);
|
||||||
|
if (dev->tty.fd < 0)
|
||||||
|
{
|
||||||
|
ERR("Could not dup stdin: %m");
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
snprintf(tty, sizeof(tty), "%s", name);
|
snprintf(tty, sizeof(tty), "%s", name);
|
||||||
|
|
Loading…
Reference in New Issue