aboutsummaryrefslogtreecommitdiff
path: root/src/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/program.c')
-rw-r--r--src/program.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/program.c b/src/program.c
index e53eb6b..e163b9b 100644
--- a/src/program.c
+++ b/src/program.c
@@ -871,12 +871,14 @@ int amal_program_save(amal_program *self, const char *filepath) {
int err = 0;
FILE *file = fopen(filepath, "wb");
if(!file) {
- err = -errno;
+ perror(filepath);
+ err = -1;
goto cleanup;
}
if(fwrite(self->data.data, 1, self->data.size, file) != self->data.size) {
- err = -errno;
+ fprintf(stderr, "Failed to write %zu bytes to %s\n", self->data.size, filepath);
+ err = -1;
goto cleanup;
}