~ycheng-twn/powerd/powerd_allow-non-root-dbus-cmd

« back to all changes in this revision

Viewing changes to src/device-config.c

  • Committer: Tarmac
  • Author(s): Seth Forshee
  • Date: 2013-09-04 15:35:02 UTC
  • mfrom: (91.1.3 coverity)
  • Revision ID: tarmac-20130904153502-wn1ix6g4y8nfxf99
Minor fixes for build and static analysis warnings.

Approved by Ricardo Salveti, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
{
284
284
    int fd, ret = 0;
285
285
    gchar *buf = NULL;
 
286
    long page_size;
286
287
    int buf_len;
287
288
    ssize_t len;
288
289
    GMarkupParseContext *context = NULL;
295
296
        return -errno;
296
297
    }
297
298
 
298
 
    buf_len = (int)sysconf(_SC_PAGESIZE);
 
299
    buf_len = 4096;
 
300
    page_size = sysconf(_SC_PAGESIZE);
 
301
    if (page_size > 0)
 
302
        buf_len = (int)page_size;
299
303
    buf = malloc(buf_len);
300
304
    if (!buf) {
301
305
        ret = -ENOMEM;