fix 32bit issues

This commit is contained in:
martijn
2017-12-03 19:07:31 +01:00
parent fd55f48267
commit 95dc8abcf3
7 changed files with 63 additions and 56 deletions

6
README
View File

@@ -18,12 +18,10 @@ Martijn van Brummelen
RELEASE NOTES
=============
v0.22
- Use const *banner instead of nwipe_options.banner(Cleanup of code)
- Update manpage
- Disable "Kill the GUI thread"
- Use ped_unit_format_byte function to display size of device
- use long long for device size
- Use ped_unit_format_byte function to display(friendly) size of device
v0.21
- Fix ETA not updating properly and bad total throughput display. Thanks (Niels Bassler).

View File

@@ -3,7 +3,7 @@
AC_PREREQ([2.64])
AC_INIT(nwipe, 0.22, git@brumit.nl)
AM_INIT_AUTOMAKE(nwipe, 0.21)
AM_INIT_AUTOMAKE(nwipe, 0.22)
AC_OUTPUT(Makefile src/Makefile man/Makefile)
AC_CONFIG_SRCDIR([src/nwipe.c])
AC_CONFIG_HEADERS([config.h])

View File

@@ -72,49 +72,49 @@ typedef struct nwipe_speedring_t_
typedef struct nwipe_context_t_
{
int block_size; /* The soft block size reported the device. */
int device_bus; /* The device bus number. */
int device_fd; /* The file descriptor of the device file being wiped. */
int device_host; /* The host number. */
struct hd_driveid device_id; /* The WIN_IDENTIFY data for IDE drives. */
int device_lun; /* The device logical unit number. */
int device_major; /* The major device number. */
int device_minor; /* The minor device number. */
int device_part; /* The device partition or slice number. */
char* device_name; /* The device file name. */
off64_t device_size; /* The device size in bytes. */
char* device_size_text ; /* The device size in a friendly format. */
struct stat device_stat; /* The device file state from fstat(). */
nwipe_device_t device_type; /* Indicates an IDE, SCSI, or Compaq SMART device. */
int device_target; /* The device target. */
u64 eta; /* The estimated number of seconds until method completion. */
int entropy_fd; /* The entropy source. Usually /dev/urandom. */
char* label; /* The string that we will show the user. */
int pass_count; /* The number of passes performed by the working wipe method. */
u64 pass_done; /* The number of bytes that have already been i/o'd in this pass. */
u64 pass_errors; /* The number of errors across all passes. */
u64 pass_size; /* The total number of i/o bytes across all passes. */
nwipe_pass_t pass_type; /* The type of the current working pass. */
int pass_working; /* The current working pass. */
nwipe_prng_t* prng; /* The PRNG implementation. */
nwipe_entropy_t prng_seed; /* The random data that is used to seed the PRNG. */
void* prng_state; /* The private internal state of the PRNG. */
int result; /* The process return value. */
int round_count; /* The number of rounds performed by the working wipe method. */
u64 round_done; /* The number of bytes that have already been i/o'd. */
u64 round_errors; /* The number of errors across all rounds. */
u64 round_size; /* The total number of i/o bytes across all rounds. */
double round_percent; /* The percentage complete across all rounds. */
int round_working; /* The current working round. */
int sector_size; /* The hard sector size reported by the device. */
nwipe_select_t select; /* Indicates whether this device should be wiped. */
int signal; /* Set when the child is killed by a signal. */
nwipe_speedring_t speedring; /* Ring buffer for computing the rolling throughput average. */
short sync_status; /* A flag to indicate when the method is syncing. */
pthread_t thread; /* The ID of the thread. */
u64 throughput; /* Average throughput in bytes per second. */
u64 verify_errors; /* The number of verification errors across all passes. */
struct hd_driveid identity; /* The serial number of the drive (where applicable) */
int block_size; /* The soft block size reported the device. */
int device_bus; /* The device bus number. */
int device_fd; /* The file descriptor of the device file being wiped. */
int device_host; /* The host number. */
struct hd_driveid device_id; /* The WIN_IDENTIFY data for IDE drives. */
int device_lun; /* The device logical unit number. */
int device_major; /* The major device number. */
int device_minor; /* The minor device number. */
int device_part; /* The device partition or slice number. */
char* device_name; /* The device file name. */
long long device_size; /* The device size in bytes. */
char* device_size_text; /* The device size in a more (human)readable format. */
struct stat device_stat; /* The device file state from fstat(). */
nwipe_device_t device_type; /* Indicates an IDE, SCSI, or Compaq SMART device. */
int device_target; /* The device target. */
u64 eta; /* The estimated number of seconds until method completion. */
int entropy_fd; /* The entropy source. Usually /dev/urandom. */
char* label; /* The string that we will show the user. */
int pass_count; /* The number of passes performed by the working wipe method. */
u64 pass_done; /* The number of bytes that have already been i/o'd in this pass. */
u64 pass_errors; /* The number of errors across all passes. */
u64 pass_size; /* The total number of i/o bytes across all passes. */
nwipe_pass_t pass_type; /* The type of the current working pass. */
int pass_working; /* The current working pass. */
nwipe_prng_t* prng; /* The PRNG implementation. */
nwipe_entropy_t prng_seed; /* The random data that is used to seed the PRNG. */
void* prng_state; /* The private internal state of the PRNG. */
int result; /* The process return value. */
int round_count; /* The number of rounds performed by the working wipe method. */
u64 round_done; /* The number of bytes that have already been i/o'd. */
u64 round_errors; /* The number of errors across all rounds. */
u64 round_size; /* The total number of i/o bytes across all rounds. */
double round_percent; /* The percentage complete across all rounds. */
int round_working; /* The current working round. */
int sector_size; /* The hard sector size reported by the device. */
nwipe_select_t select; /* Indicates whether this device should be wiped. */
int signal; /* Set when the child is killed by a signal. */
nwipe_speedring_t speedring; /* Ring buffer for computing the rolling throughput average. */
short sync_status; /* A flag to indicate when the method is syncing. */
pthread_t thread; /* The ID of the thread. */
u64 throughput; /* Average throughput in bytes per second. */
u64 verify_errors; /* The number of verification errors across all passes. */
struct hd_driveid identity; /* The serial number of the drive (where applicable) */
} nwipe_context_t;

View File

@@ -29,6 +29,8 @@
* and things like ncurses libmenu are not worth the storage overhead.
*
*/
/* Why is this needed? Segfaults without it */
#include <netinet/in.h>
#include "nwipe.h"
#include "context.h"
@@ -38,7 +40,6 @@
#include "gui.h"
#include "pass.h"
#include "logging.h"
#include "version.h"
#define NWIPE_GUI_PANE 8
@@ -227,7 +228,7 @@ void nwipe_gui_init( void )
wclear( header_window );
/* Print the product banner. */
nwipe_gui_title( header_window, banner );
nwipe_gui_title( header_window, banner );
/* Create the footer window. */
footer_window = newwin( NWIPE_GUI_FOOTER_H, NWIPE_GUI_FOOTER_W, NWIPE_GUI_FOOTER_Y, NWIPE_GUI_FOOTER_X );

View File

@@ -38,6 +38,8 @@
*
*/
/* Why is this needed? Segfaults without it */
#include <netinet/in.h>
#include "nwipe.h"
#include "context.h"

View File

@@ -21,11 +21,9 @@
*
*/
#include <netinet/in.h>
#include <time.h>
#include <signal.h>
#include <sys/shm.h>
#include <wait.h>
#include <parted/parted.h>
#include "nwipe.h"
#include "context.h"
@@ -37,6 +35,13 @@
#include "gui.h"
#include <sys/ioctl.h> /* FIXME: Twice Included */
#include <sys/shm.h>
#include <wait.h>
#include <parted/parted.h>
#include <parted/debug.h>
int main( int argc, char** argv )
{
int nwipe_optind; /* The result of nwipe_options(). */
@@ -350,7 +355,7 @@ int main( int argc, char** argv )
}
if( c2[i]->device_size == (off64_t)-1 )
if( c2[i]->device_size == (long long)-1 )
{
/* We cannot determine the size of this device. */
nwipe_perror( errno, __FUNCTION__, "lseek" );
@@ -572,7 +577,6 @@ void *signal_hand(void *ptr)
}
// Kill the GUI thread
/* Needs to be FIXED(MVB)
if( !nwipe_options.nogui )
{
if ( nwipe_misc_thread_data->gui_thread )
@@ -581,7 +585,6 @@ void *signal_hand(void *ptr)
*nwipe_misc_thread_data->gui_thread = 0;
}
}
*/
if( !nwipe_options.nogui )
nwipe_gui_free();

View File

@@ -20,6 +20,9 @@
*
*/
/* Why is this needed? Segfaults without it */
#include <netinet/in.h>
#include "nwipe.h"
#include "context.h"
#include "method.h"