diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-20 16:47:27 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-20 16:47:27 +0000 |
| commit | 9cbeb319f1e09222d5d13ee8a9d39ef54f05a844 (patch) | |
| tree | f80f7c7a2a98210d659ff9817baf3f0cc2858da3 | |
| parent | 709213a3200cd13b87565cc221f14db0fdb5d00e (diff) | |
| parent | d341ea74fc29e7522db74db00951423751acaf81 (diff) | |
Merge branch 'master' of ssh://carlh.dyndns.org/home/carl/git/libdcp
| -rw-r--r-- | src/picture_asset_writer.cc | 15 | ||||
| -rw-r--r-- | src/signer_chain.cc | 16 | ||||
| -rw-r--r-- | wscript | 2 |
3 files changed, 25 insertions, 8 deletions
diff --git a/src/picture_asset_writer.cc b/src/picture_asset_writer.cc index 51d77019..92b384db 100644 --- a/src/picture_asset_writer.cc +++ b/src/picture_asset_writer.cc @@ -49,8 +49,13 @@ FrameInfo::FrameInfo (istream& s) FrameInfo::FrameInfo (FILE* f) { - fscanf (f, "%" PRId64, &offset); - fscanf (f, "%" PRId64, &size); +#ifdef LIBDCP_WINDOWS + fscanf (f, "%I64u", &offset); + fscanf (f, "%I64u", &size); +#else + fscanf (f, "%" SCNu64, &offset); + fscanf (f, "%" SCNu64, &size); +#endif if (ferror (f)) { offset = size = 0; @@ -70,7 +75,11 @@ FrameInfo::write (ostream& s) const void FrameInfo::write (FILE* f) const { - fprintf (f, "%" PRId64 " %" PRId64 " %s", offset, size, hash.c_str ()); +#ifdef LIBDCP_WINDOWS + fprintf (f, "%I64u %I64u %s", offset, size, hash.c_str ()); +#else + fprintf (f, "%" PRIu64 " %" PRIu64 " %s", offset, size, hash.c_str ()); +#endif } diff --git a/src/signer_chain.cc b/src/signer_chain.cc index 61b0271a..d407286e 100644 --- a/src/signer_chain.cc +++ b/src/signer_chain.cc @@ -54,13 +54,18 @@ static void command (string cmd) memset (&startup_info, 0, sizeof (startup_info)); startup_info.cb = sizeof (startup_info); PROCESS_INFORMATION process_info; + + /* XXX: this doesn't actually seem to work; failing commands end up with + a return code of 0 + */ if (CreateProcessW (0, buffer, 0, 0, FALSE, CREATE_NO_WINDOW, 0, 0, &startup_info, &process_info)) { WaitForSingleObject (process_info.hProcess, INFINITE); + DWORD c; + if (GetExitCodeProcess (process_info.hProcess, &c)) { + code = c; + } CloseHandle (process_info.hProcess); CloseHandle (process_info.hThread); - DWORD c; - GetExitCodeProcess (process_info.hProcess, &c); - code = c; } delete[] buffer; @@ -85,7 +90,7 @@ static string public_key_digest (boost::filesystem::path private_key, boost::filesystem::path openssl) { boost::filesystem::path public_name = private_key.string() + ".public"; - + /* Create the public key from the private key */ stringstream s; s << "\"" << openssl.string() << "\" rsa -outform PEM -pubout -in " << private_key.string() << " -out " << public_name.string (); @@ -95,6 +100,9 @@ public_key_digest (boost::filesystem::path private_key, boost::filesystem::path string pub; ifstream f (public_name.string().c_str ()); + if (!f.good ()) { + throw libdcp::MiscError ("public key not found"); + } bool read = false; while (f.good ()) { @@ -2,7 +2,7 @@ import subprocess import os APPNAME = 'libdcp' -VERSION = '0.88pre' +VERSION = '0.91pre' def options(opt): opt.load('compiler_cxx') |
