Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/bcgsc/ntCard
06 April 2024, 01:58:22 UTC
  • Code
  • Branches (12)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/azure-macOS
    • refs/heads/low_kmer_sample_check
    • refs/heads/master
    • refs/heads/refactor
    • refs/heads/spacedseeds
    • refs/tags/1.0.0
    • refs/tags/1.0.1
    • refs/tags/1.2.0
    • refs/tags/1.2.1
    • refs/tags/1.2.2
    • refs/tags/v1.1.0
    • refs/tags/v1.1.1
    No releases to show
  • 6673230
  • /
  • Common
  • /
  • SignalHandler.cpp
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:28a08d6e026c22897bed7fb1732c5d1dff592ca3
origin badgedirectory badge Iframe embedding
swh:1:dir:944d1666550734b66e20e560551c63ecc7d4f5c9
origin badgerevision badge
swh:1:rev:9433d03872380c13bb131abf1e388e94862a4f15
origin badgesnapshot badge
swh:1:snp:9765a9dc233d6d78dbee568f9c2afba0f84bcc2b
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 9433d03872380c13bb131abf1e388e94862a4f15 authored by vlad0x00 on 05 January 2022, 21:31:33 UTC
Update formatting
Tip revision: 9433d03
SignalHandler.cpp
/**
 * Signal handling code, particularly SIGCHLD.
 */

#include "SignalHandler.h"
#include <cassert>
#include <cerrno>
#include <cstdio> // for perror
#include <cstdlib>
#include <iostream>
#include <signal.h>
#include <sys/wait.h>

using namespace std;

/** Print the specified exit status. */
static void printStatus(pid_t pid, int status)
{
    if (WIFEXITED(status))
        cerr << "PID " << pid << " exited with status "
             << WEXITSTATUS(status) << endl;
    else if (WIFSIGNALED(status))
        cerr << "PID " << pid << " killed by signal "
             << WTERMSIG(status) << endl;
    else
        cerr << "PID " << pid << " exited with code "
             << status << endl;
}

/** SIGCHLD handler. Reap child processes and report an error if any
 * fail. */
static void sigchldHandler(int sig)
{
    assert(sig == SIGCHLD);
    (void)sig;

    pid_t pid;
    int status;
    while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
        // Writing to cerr in a signal handler is not allowed, but
        // we're about to exit and an error message would be really
        // helpful.
        if (status != 0) {
            printStatus(pid, status);
            exit(EXIT_FAILURE);
        }
    }
    if (pid == -1 && errno != ECHILD) {
        perror("waitpid");
        exit(EXIT_FAILURE);
    }
}

/** Install a handler for SIGCHLD. */
void signalInit()
{
    struct sigaction action;
    action.sa_handler = sigchldHandler;
    sigemptyset(&action.sa_mask);
    action.sa_flags = SA_RESTART;
    sigaction(SIGCHLD, &action, NULL);
}

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top