1. 01 Jun, 2011 7 commits
    • Konstantin Khlebnikov's avatar
      fixup · 852efe69
      Konstantin Khlebnikov authored
      852efe69
    • Konstantin Khlebnikov's avatar
      This tries to address two issues: · a3d52a18
      Konstantin Khlebnikov authored
      (1) mkostemp with O_DIRECT in flags can fail, leaving a temporary file:
      
      Apparently, O_DIRECT is not working on top of LVM. The problem is
      in this case mkostemp() creates the temporary file but still returns
      an error, and the temp file is not removed:
      
       $ ls
       ioping  ioping.1  ioping.c  ioping.o  ioping.spec  Makefile
       $ strace ./ioping -D .
       ....
       open("./ioping.UFuMHz", O_RDWR|O_CREAT|O_EXCL|O_DIRECT, 0600) = -1 EINVAL (Invalid argument)
       ....
       $ ls
       ioping  ioping.1  ioping.c  ioping.o  ioping.UFuMHz  ioping.spec  Makefile
      
      Solution -- do not use flags, apply those later using fcntl()
      
      (2) While trying to rebuild on centos5:
      
       cc -c -o ioping.o ioping.c -std=c99 -g -Wall -Wextra -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
       ioping.c: In function 'main':
       ioping.c:369: warning: implicit declaration of function 'mkostemp'
      Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
      
      a3d52a18
    • Konstantin Khlebnikov's avatar
      'ioping -w' was going over the time limit specified. For example, · 0e36b374
      Konstantin Khlebnikov authored
      'ioping -w 7 -i 2' was taking 8 seconds to run, not 7 or less.
      Fix it by moving the check to before usleep(), and taking
      the interval (ie usleep argument) into account.
      Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
      
      0e36b374
    • Konstantin Khlebnikov's avatar
      * ioping -c|-w: do not oversleep · 9ffe820b
      Konstantin Khlebnikov authored
      This commit addresses two similar (but distinct) bugs.
      
      (1) 'ioping -c' was needlessly sleeping after the last iteration
      (and before showing final stats). Fix it by moving the check
      to before the usleep(), not after.
      
      (2) 'ioping -w' was going over the time limit specified. For example,
      'ioping -w 7 -i 2' was taking 8 seconds to run, not 7 or less.
      Fix it by moving the check to before usleep(), and taking
      the interval (ie usleep argument) into account.
      Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
      
      9ffe820b
    • Konstantin Khlebnikov's avatar
      * ioping: use system message for ENOMEM · 143c6969
      Konstantin Khlebnikov authored
      err(1, NULL) prints program name and errno string, which is
      just what we need in this case.
      Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
      
      * free temp path string
      143c6969
    • Konstantin Khlebnikov's avatar
      ioping: don't print 'unknown option' twice, show usage · b0ae5b53
      Konstantin Khlebnikov authored
      getopt() already emits warning about unknown option, so if we do that, too,
      the result will look like this:
      
      	$ ./ioping -z
      	./ioping: invalid option -- 'z'
      	ioping: unknown option: -z
      
      Don't warn about unknown option, instead show usage().
      Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
      b0ae5b53
    • Konstantin Khlebnikov's avatar
      * Makefile: add DESTDIR support · 70a194b7
      Konstantin Khlebnikov authored
      Needed mostly for distro vendors (.spec writers etc.)
      
      * Makefile: do not strip when installing
      Otherwise distros could not produce debuginfo packages
      
      * Makefile: add BINDIR
      Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
      70a194b7
  2. 31 May, 2011 1 commit
  3. 30 May, 2011 2 commits
  4. 29 May, 2011 2 commits