summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-02-02 11:59:27 -0500
committerChris Michael <cp.michael@samsung.com>2015-02-02 11:59:27 -0500
commit37d21a4729aec7044bce08640616d34faa60f940 (patch)
tree33b0d4cd31297e9c3e96d5fb3d4eec353b464eb8 /src/lib/ecore_drm
parent559b7d7ee6f5282ddc694b3fc9c5227df8303056 (diff)
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>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_tty.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_tty.c b/src/lib/ecore_drm/ecore_drm_tty.c
index f88d9f1278..f9ea64c305 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -152,7 +152,14 @@ ecore_drm_tty_open(Ecore_Drm_Device *dev, const char *name)
152 if ((env = getenv("ECORE_DRM_TTY"))) 152 if ((env = getenv("ECORE_DRM_TTY")))
153 snprintf(tty, sizeof(tty), "%s", env); 153 snprintf(tty, sizeof(tty), "%s", env);
154 else 154 else
155 dev->tty.fd = dup(STDIN_FILENO); 155 {
156 dev->tty.fd = dup(STDIN_FILENO);
157 if (dev->tty.fd < 0)
158 {
159 ERR("Could not dup stdin: %m");
160 return EINA_FALSE;
161 }
162 }
156 } 163 }
157 else 164 else
158 snprintf(tty, sizeof(tty), "%s", name); 165 snprintf(tty, sizeof(tty), "%s", name);