~ubuntu-branches/debian/jessie/ccache/jessie

« back to all changes in this revision

Viewing changes to debian/patches/15_gcc4.3_warnings.diff

  • Committer: Bazaar Package Importer
  • Author(s): Loïc Minier
  • Date: 2010-10-13 17:14:13 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101013171413-4ehrj1y89huf069u
Tags: 3.0.1-1ubuntu1
* Merge with Debian; remaining changes:
  - Add gcc/g++-4.4 and -4.5 symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff --git a/ccache.c b/ccache.c
2
 
index 8ed9892..38775cf 100644
3
 
--- a/ccache.c
4
 
+++ b/ccache.c
5
 
@@ -144,7 +144,9 @@ static const char *tmp_string(void)
6
 
                gethostname(hostname, sizeof(hostname)-1);
7
 
 #endif
8
 
                hostname[sizeof(hostname)-1] = 0;
9
 
-               asprintf(&ret, "%s.%u", hostname, (unsigned)getpid());
10
 
+               if (asprintf(&ret, "%s.%u", hostname, (unsigned)getpid()) == -1) {
11
 
+                       fatal("could not allocate tmp_string");
12
 
+               }
13
 
        }
14
 
 
15
 
        return ret;
16
 
diff --git a/stats.c b/stats.c
17
 
index ddaf768..593cd15 100644
18
 
--- a/stats.c
19
 
+++ b/stats.c
20
 
@@ -91,7 +91,7 @@ static void write_stats(int fd, unsigned counters[STATS_END])
21
 
        if (len >= (int)sizeof(buf)-1) fatal("stats too long?!");
22
 
 
23
 
        lseek(fd, 0, SEEK_SET);
24
 
-       write(fd, buf, len);
25
 
+       if (write(fd, buf, len) == -1) fatal("could not write stats");
26
 
 }
27
 
 
28
 
 
29
 
diff --git a/util.c b/util.c
30
 
index 6056d36..5b28d14 100644
31
 
--- a/util.c
32
 
+++ b/util.c
33
 
@@ -372,7 +372,9 @@ void x_asprintf(char **ptr, const char *format, ...)
34
 
 
35
 
        *ptr = NULL;
36
 
        va_start(ap, format);
37
 
-       vasprintf(ptr, format, ap);
38
 
+       if (vasprintf(ptr, format, ap) == -1) {
39
 
+               fatal("out of memory in x_asprintf");
40
 
+       }
41
 
        va_end(ap);
42
 
        
43
 
        if (!ptr) fatal("out of memory in x_asprintf");