~ubuntu-branches/ubuntu/wily/trafficserver/wily

« back to all changes in this revision

Viewing changes to lib/ts/lockfile.cc

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-12-17 22:28:16 UTC
  • mfrom: (5.1.8 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121217222816-7xwjsx5k76zkb63d
Tags: 3.2.0-1ubuntu1
* Revert FreeBSD strerror_r() fixes that give errors with glibc 2.16.
* Apply patch from Konstantinos Margaritis to define barriers on ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
    }
237
237
  } while ((err == 0) || ((err < 0) && (errno == EINTR)));
238
238
 
239
 
  if (pidv) {
240
 
    xfree(pidv);
241
 
  }
 
239
  ats_free(pidv);
242
240
 
243
241
#else
244
242
 
281
279
Lockfile::KillGroup(int sig, int initial_sig, const char *pname)
282
280
{
283
281
  int err;
284
 
  int pid;
 
282
  pid_t pid;
285
283
  pid_t holding_pid;
286
284
 
287
285
  err = Open(&holding_pid);
294
292
      pid = getpgid(holding_pid);
295
293
    } while ((pid < 0) && (errno == EINTR));
296
294
 
297
 
    if (pid < 0) {
 
295
    if ((pid < 0) || (pid == getpid()))
298
296
      pid = holding_pid;
299
 
    } else {
 
297
    else
300
298
      pid = -pid;
301
 
    }
302
299
 
303
300
    if (pid != 0) {
304
301
      // We kill the holding_pid instead of the process_group