~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/plugins/fts/fts-indexer.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2011-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2011-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "ioloop.h"
5
 
#include "network.h"
 
5
#include "net.h"
6
6
#include "istream.h"
7
7
#include "write-full.h"
8
8
#include "strescape.h"
51
51
        cmd = t_strconcat(INDEXER_HANDSHAKE, cmd, NULL);
52
52
        if (write_full(fd, cmd, strlen(cmd)) < 0) {
53
53
                i_error("write(%s) failed: %m", path);
54
 
                (void)close(fd);
 
54
                i_close_fd(&fd);
55
55
                return -1;
56
56
        }
57
57
        *path_r = path;
191
191
                        return 1;
192
192
                }
193
193
        }
194
 
        if (ctx->input->eof || ctx->input->stream_errno != 0) {
 
194
        if (ctx->input->stream_errno != 0) {
 
195
                i_error("indexer read() failed: %m");
 
196
                return -1;
 
197
        }
 
198
        if (ctx->input->eof) {
195
199
                i_error("indexer disconnected unexpectedly");
196
200
                return -1;
197
201
        }
212
216
           asynchronous waits, get rid of this wait and use the mail IO loop */
213
217
        ioloop = io_loop_create();
214
218
        io = io_add(ctx->fd, IO_READ, io_loop_stop, ioloop);
215
 
        to = timeout_add(INDEXER_WAIT_MSECS, io_loop_stop, ioloop);
 
219
        to = timeout_add_short(INDEXER_WAIT_MSECS, io_loop_stop, ioloop);
216
220
        io_loop_run(ioloop);
217
221
        io_remove(&io);
218
222
        timeout_remove(&to);