~xavi-garcia-mena/keeper/mcloud-provided-crash-test

« back to all changes in this revision

Viewing changes to tests/fakes/fake-backup-helper.cpp

  • Committer: Charles Kerr
  • Author(s): Marcus Tomlinson
  • Date: 2016-08-29 21:05:21 UTC
  • mfrom: (91.4.15 trunk)
  • Revision ID: charles.kerr@canonical.com-20160829210521-tcwrqv2nivy7t1ym
mergeĀ lp:~marcustomlinson/keeper/link-against-real-storage-framework

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <QProcessEnvironment>
31
31
#include <QLocalSocket>
32
32
 
 
33
#include <unistd.h>
 
34
 
33
35
int
34
36
main(int argc, char **argv)
35
37
{
71
73
    const auto ufd = fd_reply.value();
72
74
 
73
75
    // write the blob
74
 
    QLocalSocket sock;
75
 
    sock.setSocketDescriptor(ufd.fileDescriptor());
76
 
    qDebug() << "wrote" << sock.write(blob) << "bytes";
77
 
    sock.flush();
 
76
    const auto fd = ufd.fileDescriptor();
 
77
    const auto n_written_in = write(fd, blob.constData(), blob.size());
 
78
    qDebug() << "wrote" << n_written_in << "bytes";
78
79
 
79
80
    // create the mark file so we can check when it finished without upstart
80
81
    QFile markFile(SIMPLE_HELPER_MARK_FILE_PATH);