~ubuntu-branches/ubuntu/utopic/libgtop2/utopic-proposed

« back to all changes in this revision

Viewing changes to sysdeps/linux/fsusage.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-02-17 23:12:12 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20090217231212-yhcddg53iyuwddsl
Tags: 2.25.91-0ubuntu1
* New upstream release (LP: #330751)
  - Synced with gnome-2-24.
  - Fixed license: libgtop is GPL-2.
  - linux:
    - fixed potential memory leak.
    - fixed read(2) usage. Should fix the missing cpus bug in
      system-monitor.
  - darwin:
    - fixed build. "paul".
* debian/patches/50_linux260_leak_fix.patch removed: upstream fixed it

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
 
130
130
static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
131
131
{
132
 
        char *filename;
 
132
        char *filename = NULL;
133
133
        const char *format;
134
134
        int ret;
135
135
        char buffer[BUFSIZ];
136
136
        char device[64];
137
137
 
138
138
        if (!get_device(server, path, device, sizeof device))
139
 
                return;
 
139
                goto out;
140
140
 
141
141
        get_sys_path(server, device, &filename, &format);
142
142
 
143
143
        ret = try_file_to_buffer(buffer, sizeof buffer, filename);
144
144
 
145
 
        if(ret < 0) return;
 
145
        if (ret < 0) goto out;
146
146
 
147
147
        if (sscanf(buffer, format, &buf->read, &buf->write) != 2) {
148
148
                glibtop_warn_io_r(server, "Could not parse %s", filename);
149
 
                return;
 
149
                goto out;
150
150
        }
151
151
 
 
152
        buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
 
153
 out:
152
154
        g_free(filename);
153
 
 
154
 
        buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
155
155
}
156
156
 
157
157