summaryrefslogtreecommitdiffstats
path: root/libdimension/scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/scene.c')
-rw-r--r--libdimension/scene.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdimension/scene.c b/libdimension/scene.c
index 8ebf706..4595afd 100644
--- a/libdimension/scene.c
+++ b/libdimension/scene.c
@@ -19,6 +19,7 @@
*************************************************************************/
#include "dimension.h"
+#include <errno.h>
#include <stdlib.h> /* For malloc */
#include <unistd.h> /* For sysconf */
@@ -31,6 +32,7 @@ dmnsn_new_scene()
scene->default_texture = dmnsn_new_texture();
if (!scene->default_texture) {
dmnsn_delete_scene(scene);
+ errno = ENOMEM;
return NULL;
}
@@ -46,6 +48,8 @@ dmnsn_new_scene()
if (nprocs < 1)
nprocs = 1;
scene->nthreads = nprocs;
+ } else {
+ errno = ENOMEM;
}
return scene;
}