Changeset 714 for trunk/daemon/src/get.c

Show
Ignore:
Timestamp:
03/08/10 19:49:12 (2 years ago)
Author:
cryptronic
Message:

Make the cgroup stuff more configurable.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/daemon/src/get.c

    r708 r714  
    465465        response = ovcp_response_new(); 
    466466 
    467         ovcp_response_struct_new(response); 
    468  
    469467        while(cgroup_params[i] != NULL) 
    470468        { 
     
    473471                if(file_exist(path)) 
    474472                { 
    475                         value = file_read(path); 
    476  
     473                        ovcp_response_struct_new(response); 
     474 
     475                        ovcp_response_struct_add_string(response, "name", cgroup_params[i]); 
     476 
     477                        value = file_read(path); 
    477478                        if(value != NULL) 
    478479                        { 
    479480                                trim_string(value); 
    480                                 ovcp_response_struct_add_string(response, cgroup_params[i], value); 
     481                                ovcp_response_struct_add_string(response, "value", value); 
    481482                                free(value); 
    482483                        } 
     484                        else 
     485                        { 
     486                            ovcp_response_struct_add_string(response, "value", ""); 
     487                        } 
     488 
     489                        ovcp_response_struct_end(response); 
    483490                } 
    484491 
    485492                i++; 
    486493        } 
    487  
    488         ovcp_response_struct_end(response); 
    489494 
    490495        return response;