~ubuntu-branches/debian/experimental/libeatmydata/experimental

« back to all changes in this revision

Viewing changes to eatmydatatest.c

  • Committer: Bazaar Package Importer
  • Author(s): Modestas Vainius
  • Date: 2011-01-02 17:21:29 UTC
  • Revision ID: james.westby@ubuntu.com-20110102172129-q8axwliijo3ml1ed
Tags: 15-5
* Get rid of the debian-changes-* patch introduced by mistake in the previous
  upload.
* Forbid generation of the single debian patch by adding
  abort-on-upstream-changes to debian/source/local-options.
* Add unapply-patches to debian/source/local-options.
* Merge Ubuntu patches;
  - ubuntu_as_needed_fix.diff (with small tweak) to
    upstream_improve_Makefile.diff;
  - ubuntu_missing_open_arg.diff (with tweak) to
    upstream_portable_testsuite.diff.
* Fix relative path recognition as per IEEE Std 1003.1 Shell Command
  Language Specification, chapter 2.9. (Closes: #606157)
* Remove config.h in distclean target (upstream_basic_autoconf.diff
  modified).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <errno.h>
20
20
#include <sys/mman.h>
21
21
#include <unistd.h>
 
22
#include <sys/stat.h>
22
23
 
23
24
int failed_tests = 0;
24
25
 
37
38
    int fd, res;
38
39
 
39
40
    res = -1;
40
 
    fd = open(DATAFILENAME, O_CREAT|O_TRUNC|O_WRONLY|flag);
 
41
    fd = open(DATAFILENAME, O_CREAT|O_TRUNC|O_WRONLY|flag, S_IRUSR|S_IWUSR);
41
42
    if (fd != -1) {
42
43
        res = fcntl(fd, F_GETFL);
43
44
    }
61
62
    TESTCASE(test_open_flag(O_DSYNC), 0, "open(O_DSYNC) flag was not filtered out");
62
63
 
63
64
    // Open and close FD in order to make sure its invalid.
64
 
    fd = open(DATAFILENAME, O_CREAT|O_TRUNC|O_WRONLY);
 
65
    fd = open(DATAFILENAME, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR);
65
66
    if (fd == -1)
66
67
        perror("unable to open " DATAFILENAME);
67
68
    if (close(fd) == -1)