uriloader/exthandler/tests/WriteArgument.cpp
author Benjamin Smedberg <benjamin@smedbergs.us>
Tue, 12 Jan 2010 16:53:10 -0500
changeset 37206 e828ac5006650b19def0b3b35cca72b80ef46548
parent 15220 b5b210b0cd7ee10e89c9933164832604d608a868
child 450554 09c71a7cf75aeaf2963050e315276fb9a866fd62
permissions -rw-r--r--
Bug 539290 - Test harness should look for minidumps from child (plugin) processes but not turn the tree orange automatically, r=ted

#include <stdio.h>
#include "prenv.h"

int main(int argc, char* argv[])
{
  if (argc != 2)
    return 1;

  const char* value = PR_GetEnv("WRITE_ARGUMENT_FILE");

  if (!value)
    return 2;

  FILE* outfile = fopen(value, "w");
  if (!outfile)
    return 3;

  // We only need to write out the first argument (no newline).
  fputs(argv[argc -1], outfile);

  fclose(outfile);

  return 0;
}