~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to testsuite/expect/test7.3.io.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 *  Copyright (C) 2004 The Regents of the University of California.
10
10
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
11
11
 *  Written by Morris Jette <jette1@llnl.gov>
12
 
 *  LLNL-CODE-402394.
 
12
 *  CODE-OCEC-09-009. All rights reserved.
13
13
 *  
14
14
 *  This file is part of SLURM, a resource management program.
15
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
15
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
16
 *  Please also read the included file: DISCLAIMER.
16
17
 *  
17
18
 *  SLURM is free software; you can redistribute it and/or modify it under
18
19
 *  the terms of the GNU General Public License as published by the Free
37
38
int main(int argc, char **argv)
38
39
{
39
40
        char buf1[128], buf2[128], *tmp;
40
 
        int size, j, procid = -1;
 
41
        int size, j, procid = -1, rc = 0;
41
42
 
42
43
        tmp = getenv("SLURM_PROCID");
43
44
        if (tmp)
44
45
                procid = atoi(tmp);
45
46
        sprintf(buf1, "task %d write to stdout:", procid);
46
 
        write(STDOUT_FILENO, buf1, strlen(buf1));
 
47
        rc = write(STDOUT_FILENO, buf1, strlen(buf1));
47
48
        sprintf(buf1, "task %d write to stderr:", procid);
48
 
        write(STDOUT_FILENO, buf1, strlen(buf1));
 
49
        rc = write(STDOUT_FILENO, buf1, strlen(buf1));
49
50
        while  ((size = read(STDIN_FILENO, buf1, sizeof(buf1))) != 0) {
50
51
                if (size > 0) {
51
52
                        int offset;
55
56
                                buf2[offset+j] = buf1[j];
56
57
                        buf2[offset+j] = ':';
57
58
                        buf2[offset+j+1] = '\0';
58
 
                        write(STDOUT_FILENO, buf2, strlen(buf2));
 
59
                        rc = write(STDOUT_FILENO, buf2, strlen(buf2));
59
60
                        break;
60
61
                } else {
61
62
                        if ((errno == EINTR) || (errno == EAGAIN)) {
63
64
                                continue;
64
65
                        }
65
66
                        sprintf(buf1, "io read errno:%d:", errno);
66
 
                        write(STDOUT_FILENO, buf1, strlen(buf1));
 
67
                        rc = write(STDOUT_FILENO, buf1, strlen(buf1));
67
68
                        break;
68
69
                }
69
70
        }