paul@0 | 1 | /* |
paul@0 | 2 | * Common shutdown functionality. |
paul@0 | 3 | * |
paul@0 | 4 | * Copyright (C) 2013 Paul Boddie |
paul@0 | 5 | * |
paul@0 | 6 | * This program is free software; you can redistribute it and/or modify |
paul@0 | 7 | * it under the terms of the GNU General Public License as published by |
paul@0 | 8 | * the Free Software Foundation; either version 2 of the License, or |
paul@0 | 9 | * (at your option) any later version. |
paul@0 | 10 | */ |
paul@0 | 11 | |
paul@0 | 12 | #include <stdio.h> |
paul@0 | 13 | #include <stdlib.h> |
paul@0 | 14 | #include <ubb/ubb.h> |
paul@0 | 15 | |
paul@0 | 16 | /** |
paul@0 | 17 | * Handle termination of the process. |
paul@0 | 18 | */ |
paul@0 | 19 | void init_shutdown(int signum) |
paul@0 | 20 | { |
paul@0 | 21 | printf("Closing...\n"); |
paul@0 | 22 | ubb_close(0); |
paul@0 | 23 | exit(1); |
paul@0 | 24 | } |