File: add_more_error_reporting.diff

package info (click to toggle)
libimage-imlib2-perl 2.03-1.2~deb12u1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 320 kB
  • sloc: perl: 305; ansic: 112; makefile: 9
file content (53 lines) | stat: -rw-r--r-- 2,375 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Adds additional error checking with useful errors when image loads fail in IMLIB

Index: libimage-imlib2-perl/lib/Image/Imlib2.xs
===================================================================
--- libimage-imlib2-perl.orig/lib/Image/Imlib2.xs	2011-10-15 17:19:35.000000000 -0700
+++ libimage-imlib2-perl/lib/Image/Imlib2.xs	2011-10-15 17:19:52.000000000 -0700
@@ -181,6 +181,46 @@
                 if (err == IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT) {
                   Perl_croak(aTHX_ "Image::Imlib2 load error: No loader for file format");
                 }
+
+                if (err == IMLIB_LOAD_ERROR_PATH_TOO_LONG) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Path too long");
+                }
+		
+                if (err == IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Path component non existant");
+                }
+
+                if (err == IMLIB_LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Path component not directory");
+                }
+
+                if (err == IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Path points outside address space");
+                }
+
+                if (err == IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Too many symbolic links");
+                }
+
+                if (err == IMLIB_LOAD_ERROR_OUT_OF_MEMORY) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Out of memory");
+                }
+
+                if (err == IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Out of file descriptors");
+                }
+
+                if (err == IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Permission denied to write");
+                }
+
+                if (err == IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Out of disk space");
+                }
+
+		if (err == IMLIB_LOAD_ERROR_UNKNOWN) {
+                  Perl_croak(aTHX_ "Image::Imlib2 load error: Unknown");
+		}
 		RETVAL = image;
 	}
         OUTPUT: