author Tom Prince <mozilla@hocat.ca>
Tue, 28 Jul 2020 20:30:12 +0000
changeset 605812 91a49863cb444e464ef6535f252c7e83182a9ff6
parent 508251 66eb1f485c1a3ea81372758bc92292c9428b17cd
permissions -rw-r--r--
Bug 1653190: Fix handling of checksum format in python 2 vs 3; r=mtabara a=tomprince DONTBUILD We switched to using python 3 to run generate-checksums, this caused the checksum files to have an extra `b''` in them. The original fix caused the generation of merkletree to fail. This moves the code that encodes the hash closer to where it is output. Differential Revision: https://phabricator.services.mozilla.com/D85196

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=4 et :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <dlfcn.h>
#include <android/log.h>

int main(int argc, char* argv[]) {
  // Check for the absolute minimum number of args we need to move
  // forward here. We expect the last arg to be the child process type.
  if (argc < 2) return 1;

  void* mozloader_handle = dlopen("libmozglue.so", RTLD_LAZY);
  if (!mozloader_handle) {
    __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad",
                        "Couldn't load mozloader because %s", dlerror());
    return 1;

  typedef int (*ChildProcessInit_t)(int, char**);
  ChildProcessInit_t fChildProcessInit =
      (ChildProcessInit_t)dlsym(mozloader_handle, "ChildProcessInit");
  if (!fChildProcessInit) {
    __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad",
                        "Couldn't load cpi_t because %s", dlerror());
    return 1;

  return fChildProcessInit(argc, argv);