Handle the EINTR error when doing a waitpid() in wvmagicloopback.
[wvapps.git] / evolution / genupdate.cc
blob6adae341d31a24f47f2a826173295833e997798c
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: s; c-basic-offset: 4 -*- */
2 /*
3 * Authors : Patrick Patterson <ppatters@nit.ca>
4 * Peter Colijn <pcolijn@nit.ca>
5 * Scott MacLean <scott@nit.ca>
6 * William Lachance <wlach@nit.ca>
8 * Copyright 2003-2004, Net Integration Technologies, Inc.
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
25 #include "genupdate.h"
26 #include "wvstrutils.h"
27 #include "exchangeitstorage.h"
28 #include "wvstringlist.h"
29 #include "genupdate.h"
30 #include "updateitem.h"
32 bool GenUpdate::apply_response(WvStringList &parts,
33 WvStream &stream,
34 ExchangeItStorage *storage)
36 if (parts.count() < 3)
38 log(WvLog::Debug1, "Malformed generic UPDATE command!\n");
39 return false;
42 WvString folder_name = web_unescape(parts.popstr());
43 WvString folder_type = web_unescape(parts.popstr());
44 WvString uid = web_unescape(parts.popstr());
45 WvString line;
47 ExchangeItAdaptor *adaptor = storage->get_dict()[folder_name];
48 if (!adaptor)
50 log(WvLog::Debug1, "Could not find adaptor for %s!\n", folder_name);
51 return false;
54 UpdateItem update(stream, adaptor, uid);
55 bool success = update.update();
57 log(WvLog::Debug1, "Finished generic UPDATE, returning %s\n", success);
58 return success;