~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/gis/writ_zeros.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
 
/**
3
 
 * \file writ_zeros.c
 
2
/*!
 
3
 * \file lib/gis/writ_zeros.c
4
4
 *
5
5
 * \brief GIS Library - Write zero functions.
6
6
 *
7
 
 * (C) 2001-2008 by the GRASS Development Team
 
7
 * (C) 2001-2014 by the GRASS Development Team
8
8
 *
9
9
 * This program is free software under the GNU General Public License
10
10
 * (>=v2). Read the file COPYING that comes with GRASS for details.
11
11
 *
12
12
 * \author GRASS GIS Development Team
13
13
 *
14
 
 * \date 1999-2008
 
14
 * \date 1999-2014
15
15
 */
16
16
 
17
17
#include <unistd.h>
23
23
 *
24
24
 * \param[in] fd file descriptor
25
25
 * \param[in] n number of bytes to write
26
 
 * \return always returns 0
 
26
 * \return
27
27
 */
28
28
 
29
 
int G_write_zeros(int fd, size_t n)
 
29
void G_write_zeros(int fd, size_t n)
30
30
{
31
31
    char zeros[1024];
32
32
    char *z;
33
33
    int i;
34
34
 
35
35
    if (n <= 0)
36
 
        return 0;
 
36
        return;
37
37
 
38
38
    /* There is a subtle gotcha to be avoided here.
39
39
     *
61
61
        write(fd, zeros, i);
62
62
        n -= i;
63
63
    }
64
 
 
65
 
    return 0;
66
64
}