~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002110857

« back to all changes in this revision

Viewing changes to src/libs/zbxsysinfo/linux/kernel.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Ablassmeier
  • Date: 2007-07-02 09:06:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070702090651-8l6fl3fjw9rh6l2u
Tags: 1:1.4.1-2
Add patch from SVN in order to fix Incorrect processing of character '%'
in user parameters and remote commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
18
**/
19
19
 
20
 
#include "config.h"
21
 
 
22
20
#include "common.h"
 
21
 
23
22
#include "sysinfo.h"
24
23
 
25
24
int     KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
35
34
 
36
35
        init_result(result);    
37
36
 
38
 
        f=fopen("/proc/sys/fs/file-max","r");
39
 
        if(f)
 
37
        if(NULL != ( f = fopen("/proc/sys/fs/file-max","r") ))
40
38
        {
41
39
                if(fgets(line,MAX_STRING_LEN,f) != NULL);
42
40
                {
46
44
                                ret = SYSINFO_RET_OK;
47
45
                        }
48
46
                }
49
 
                fclose(f);
 
47
                zbx_fclose(f);
50
48
        }
51
49
 
52
50
        return ret;