Merge branch 'swap_protocol' of 106.109.8.71:/srv/git/sdk/dynamic-analysis-manager...
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 1 Aug 2013 12:01:01 +0000 (16:01 +0400)
committerVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 1 Aug 2013 12:01:01 +0000 (16:01 +0400)
Conflicts:
daemon/sys_stat.c

1  2 
daemon/daemon.c
daemon/sys_stat.c
daemon/threads.c

diff --cc daemon/daemon.c
Simple merge
@@@ -110,34 -110,6 +110,34 @@@ static uint64_t mem_slot_array[MEM_SLOT
  static CPU_t* cpus = NULL;
  static unsigned long probe_so_size = 0;
  
-                       status =  -(errno)
 +
 +int get_file_status_no_open(int pfd, const char* filename)
 +{
 +      int status = 0;
 +
 +#ifndef LOCALTEST
 +      if (likely(pfd != NULL))
 +      {
 +              if (unlikely(pfd < 0)) {
 +                      // open file first
 +                      return 0;
 +              }
 +
 +              char buf[STATUS_STRING_MAX];
 +
 +
 +              lseek(pfd, 0, SEEK_SET);        // rewind to start of file
 +
 +              // read from file
 +              if (unlikely(read(pfd, buf, STATUS_STRING_MAX) == -1))
++                      status =  -(errno);
 +              else
 +                      status = atoi(buf);
 +      }
 +#endif
 +
 +      return status;
 +}
  // daemon api : get status from file
  // pfd must not be null
  int get_file_status(int* pfd, const char* filename)
Simple merge