On Friday, 3 August 2007 23:14, Alon Bar-Lev wrote:
> On Friday 03 August 2007, Rafael J. Wysocki wrote:
> > On Friday, 3 August 2007 01:15, Alon Bar-Lev wrote:
> > >
> > > encrypt variable conflict with glibc::encrypt()
> > > Rename it to encrypt_on
> >
> > I'd prefer do_encrypt.
>
> OK.
Thanks.
I'm going to apply the patch if there are no objections.
Greetings,
Rafael
> ---
>
> diff -urNp suspend.org/suspend.c suspend-0.6_beta1/suspend.c
> --- suspend.org/suspend.c 2007-07-29 21:30:27.000000000 +0300
> +++ suspend-0.6_beta1/suspend.c 2007-08-02 23:55:20.000000000 +0300
> @@ -68,10 +68,10 @@ static char compress;
> #ifdef CONFIG_ENCRYPT
> -static char encrypt;
> +static char do_encrypt;
> static char use_RSA;
> static char key_name[MAX_STR_LEN] = KEY_FILE;
> static char password[PASS_SIZE];
> #else
> -#define encrypt 0
> +#define do_encrypt 0
> #define key_name NULL
> #endif
> #ifdef CONFIG_BOTH
> @@ -142,7 +137,7 @@ static struct config_par parameters[PARA
> {
> .name = "encrypt",
> .fmt = "%c",
> - .ptr = &encrypt,
> + .ptr = &do_encrypt,
> },
> {
> .name = "RSA key file",
> @@ -350,7 +347,7 @@ static int flush_buffer(struct swap_map_
> int error = 0;
>
> #ifdef CONFIG_ENCRYPT
> - if (encrypt) {
> + if (do_encrypt) {
> error = gcry_cipher_encrypt(cipher_handle,
> handle->encrypt_buffer, handle->cur_area.size,
> src, handle->cur_area.size);
> @@ -610,7 +607,7 @@ int write_image(int snapshot_fd, int res
> }
>
> #ifdef CONFIG_ENCRYPT
> - if (encrypt) {
> + if (do_encrypt) {
> if (use_RSA) {
> error = gcry_cipher_setkey(cipher_handle,
> key_data->key, KEY_SIZE);
> @@ -1325,8 +1321,8 @@ int main(int argc, char *argv[])
> compress = 0;
> #endif
> #ifdef CONFIG_ENCRYPT
> - if (encrypt != 'y' && encrypt != 'Y')
> - encrypt = 0;
> + if (do_encrypt != 'y' && do_encrypt != 'Y')
> + do_encrypt = 0;
> #endif
> if (splash_param != 'y' && splash_param != 'Y')
> splash_param = 0;
> @@ -1534,5 +1534,5 @@ int main(int argc, char *argv[])
> #ifdef CONFIG_ENCRYPT
> - if (encrypt)
> + if (do_encrypt)
> mem_size += buffer_size;
> #endif
> mem_pool = malloc(mem_size);
> @@ -1361,7 +1365,7 @@ int main(int argc, char *argv[])
> return ret;
> }
> #ifdef CONFIG_ENCRYPT
> - if (encrypt) {
> + if (do_encrypt) {
> printf("%s: libgcrypt version: %s\n", my_name,
> gcry_check_version(NULL));
> gcry_control(GCRYCTL_INIT_SECMEM, page_size, 0);
> @@ -1370,10 +1374,10 @@ int main(int argc, char *argv[])
> if (ret) {
> fprintf(stderr, "%s: libgcrypt error %s\n", my_name,
> gcry_strerror(ret));
> - encrypt = 0;
> + do_encrypt = 0;
> }
> }
> - if (encrypt) {
> + if (do_encrypt) {
> mem_size -= buffer_size;
> key_data = (struct key_data *)((char *)mem_pool + mem_size);
> generate_key();
> @@ -1474,7 +1478,7 @@ int main(int argc, char *argv[])
> s2ram = !s2ram_hacks();
> #endif
> #ifdef CONFIG_ENCRYPT
> - if (encrypt && ! use_RSA) {
> + if (do_encrypt && ! use_RSA) {
> splash.read_password((char *)mem_pool,1);
> strncpy(password,(char *)mem_pool,PASS_SIZE);
> }
> @@ -1524,8 +1528,8 @@ Umount:
> } else {
> umount(chroot_path);
> }
> #ifdef CONFIG_ENCRYPT
> - if (encrypt)
> + if (do_encrypt)
> gcry_cipher_close(cipher_handle);
> #endif
> free(mem_pool);
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Suspend-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/suspend-devel
>
>
--
"Premature optimization is the root of all evil." - Donald Knuth
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel