オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.6.x/ccs-tools/ccstools/candy.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1743 by kumaneko, Mon Oct 20 12:20:28 2008 UTC revision 1744 by kumaneko, Thu Oct 23 05:42:28 2008 UTC
# Line 6  Line 6 
6   *   *
7   * Copyright (C) 2005-2008  NTT DATA CORPORATION   * Copyright (C) 2005-2008  NTT DATA CORPORATION
8   *   *
9   * Version: 1.6.5-pre   2008/10/20   * Version: 1.6.5-pre   2008/10/23
10   */   */
11  #include <stdio.h>  #include <stdio.h>
12  #include <string.h>  #include <string.h>
# Line 25  static const char *get_shell(void) Line 25  static const char *get_shell(void)
25          return shell;          return shell;
26  }  }
27    
28  static int GetStartTime(pid_t pid, unsigned long long *t)  static int get_start_time(pid_t pid, unsigned long long *t)
29  {  {
30          FILE *fp;          FILE *fp;
31          int i;          int i;
# Line 66  int main(int argc, char *argv[]) Line 66  int main(int argc, char *argv[])
66                  if (shell && !strcmp(buffer, passwd)) {                  if (shell && !strcmp(buffer, passwd)) {
67                          unsigned long long t0;                          unsigned long long t0;
68                          unsigned long long t1;                          unsigned long long t1;
69                          if (GetStartTime(getppid(), &t0) == 0 &&                          if (get_start_time(getppid(), &t0) == 0 &&
70                              GetStartTime(getpid(), &t1) == 0) {                              get_start_time(getpid(), &t1) == 0) {
71                                  /* 10 sec */                                  /* 10 sec */
72                                  if ((t1 - t0) < 1000)                                  if ((t1 - t0) < 1000)
73                                          execlp(shell, shell, NULL);                                          execlp(shell, shell, NULL);

Legend:
Removed from v.1743  
changed lines
  Added in v.1744

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26